Ronin
Aspiring developer
Profile
Posts: 19
Reg: Jul 13, 2012
Arlington, VA
2,240
08/06/12 08:17 PM (13 years ago)

Still getting code alerts

Hello, When I build my projects in Xcode 4.4 and iPhone Simulator 5.1 and 5.0, I get 30+ alerts. All but three were solved by this solution: http://www.buzztouch.com/forum/thread.php?tid=7C16B9C2E02ED2E15089B6E&sortColumn=FT.id&sortUpDown=DESC&currentPage=1 However, I still get the following three alerts and don't know how to fix them. Any help would be greatly appreciated. BT_fileManager.m 1. Data argument not used by format string [BT_debugger showIt:self:[NSString stringWithFormat:@"readTextFileFromBundleWithEncoding ERROR using encoding NSUTF8StringEncoding, trying NSISOLatin1StringEncoding", @""]]; 2. Data argument not used by format string [BT_debugger showIt:self:[NSString stringWithFormat:@"readTextFileFromCacheWithEncoding ERROR using encoding NSUTF8StringEncoding, trying NSISOLatin1StringEncoding", @""]]; BT_camera_email.m 1. Semantic Issue Sending 'BT_camera_email *' to parameter of incompatible type 'id<UIActionSheetDelegate>' if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { NSLog(@"is camera ok"); UIActionSheet *photoSourceSheet = [[UIActionSheet alloc] initWithTitle:@"Select Image Source" delegate:self Thanks. Ronin
 
GeGro
Apple Fan
Profile
Posts: 14
Reg: Jul 11, 2012
Mülheim-Kärli...
1,890
like
08/07/12 10:39 AM (13 years ago)
I have the same errors! Any help from buzztouch would be greatly appreciated!
 
Ronin
Aspiring developer
Profile
Posts: 19
Reg: Jul 13, 2012
Arlington, VA
2,240
like
08/07/12 04:16 PM (13 years ago)
Hey GeGro, Some helpful people on both StackOverflow and Reddit, helped me figure out the alerts and have posited a theory on the BT_camera_email.m issue. On the first two alerts, User _lowell and Reddit explained: "The 'Data argument not used by format string' warnings are because the format strings being fed to +[NSString stringWithFormat:] have that blank string argument(, @""), but no token (%@) in which to place it. It shouldn't be there at all." So, instead of: [BT_debugger showIt:self:[NSString stringWithFormat:@"readTextFileFromBundleWithEncoding ERROR using encoding NSUTF8StringEncoding, trying NSISOLatin1StringEncoding", @""]]; it should be: [BT_debugger showIt:self:[NSString stringWithFormat:@"readTextFileFromBundleWithEncoding ERROR using encoding NSUTF8StringEncoding, trying NSISOLatin1StringEncoding"]]; Just delete the , @"" portion at the end of the code. For the second argument a helpful Stack Overflow explained: "To be sure about the second one, I'd want to see the .h file that declares BT_camera_email but my best guess is that it doesn't adopt the UIActionSheetDelegate protocol. The description of initWithTitle:... says the second parameter should be id<UIActionSheetDelegate> and that's probably what is being complained about." Reddit user _lowell explained: "The other one looks like BT_camera_email just needs to adopt <UIActionSheetDelegate>." For the first alerts, their explanations fixed the problem right away. For the BT_camera_email problem, I'm looking in to how to fix this and will get back to you if I figure it out. Hope that helps. Ronin
 
Ronin
Aspiring developer
Profile
Posts: 19
Reg: Jul 13, 2012
Arlington, VA
2,240
like
08/07/12 04:31 PM (13 years ago)
All right, I figured out the second part. The problem is actually really easy to fix once you realize what's going on. The problem appears in the BT_camera_email.m file because of an issue with the BT_camera_email.h file as the StackOverflow user guessed. Basically, the BT_camera_email.m tries to call something that's supposed to be in the BT_camera_email.h file, but isn't there. So, go to BT_camera_email.h file in the BT_Plugins>bt_camera_email>BT_camera_email.h. Find the following line of code: @interface BT_camera_email : BT_viewController <UIApplicationDelegate, UIImagePickerControllerDelegate,MFMailComposeViewControllerDelegate, UINavigationControllerDelegate, UIAlertViewDelegate> You need to add UIActionSheetDelegate into this line of code. I just put it on the end like this: @interface BT_camera_email : BT_viewController <UIApplicationDelegate, UIImagePickerControllerDelegate,MFMailComposeViewControllerDelegate, UINavigationControllerDelegate, UIAlertViewDelegate, UIActionSheetDelegate> Now, it's all fixed. Hope that helps.
 
GeGro
Apple Fan
Profile
Posts: 14
Reg: Jul 11, 2012
Mülheim-Kärli...
1,890
like
08/08/12 07:42 AM (13 years ago)
Sounds good! Thank you!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.