How to solve “Application failed codesign verification” when uploading to iTunes Connect?

I found the solution to this problem after deeply looking at the log file. Although I created my own Distribution Profile and assigned to the CODE SIGNING IDENTITY the correct value for the developer certificate, it didn’t work giving me an error: “Application failed codesign verification”. The problem is at the following line: Authority=iPhone Developer: … Read more

how to get the event that switch tab menu on iphone

Implement UITabBarControllerDelegate e.g. in your app delegate’s applicationDidFinishLaunching – (void)applicationDidFinishLaunching:(UIApplication *)application { tabBarController.delegate = self; [window addSubview:tabBarController.view]; } Then implement either: – (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController; – (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController; The first method is called before the view switch and gives you a chance to ‘veto’ the view switch by returning NO The second … Read more

Write only property in Objective-C

Another valid approach is to declare the normal property and make the getter unavailable @interface MyClass @property NSString * var; – (NSString *)var UNAVAILABLE_ATTRIBUTE; @end This will raise a compile-time error in case someone tries to access the getter. The main advantage of this approach is that you actually have a real propertyTM and not … Read more

Adding image to navigation bar

In your case, this solution found in another answer would work well. With the “CustomImage” category added to UINavigationBar, you can then just call: UINavigationBar *navBar = self.navigationController.navigationBar; UIImage *image = [UIImage imageNamed:@”yourNavBarBackground.png”]; [navBar setBackgroundImage:image]; This code should go in the method – (void)viewWillAppear:(BOOL)animated of the view controller where you want to have the custom … Read more

How to hide a section in UITableView?

Actually, you can “hide” a section. If you want to use a similar behaviour to the built-in contacts app, where sections are hidden but still listed in the index on the right you can do the following: Implement the UITableViewDataSource protocol: Return all section names (even hidden ones) in – the sectionIndexTitlesForTableView method. For each … Read more

Best way to check if an iPhone app is running for the first time

I like to use NSUserDefaults to store an indication of the the first run. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if (![defaults objectForKey:@”firstRun”]) [defaults setObject:[NSDate date] forKey:@”firstRun”]; [[NSUserDefaults standardUserDefaults] synchronize]; You can then test for it later… NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if([defaults objectForKey:@”firstRun”]) { // do something or not… }

Code Sign error: The identity ‘iPhone Developer: x Xxxxx’ doesn’t match any identity in any profile

Right Click the Project (eg. x.xcodeproject) and select Show Package Content Open project.pbxproj with TextEdit Search for all “CODE_SIGN_IDENTITY[sdk=iphoneos*]” and set it to “CODE_SIGN_IDENTITY[sdk=iphonesos*]” = “iPhone Developer”; Search for “PROVISIONING_PROFILE[sdk=iphoneos*]” and set it to “PROVISIONING_PROFILE[sdk=iphoneos*]” = “”; Save the file Reopen the Xcode project or select “Read from Disk” resulting from Xcode the prompt. This … Read more

Detecting the iPhone’s Ring / Silent / Mute switch using AVAudioPlayer not working?

Well I found the answer thanks to someone from the Developer Forums, and you guys aren’t gonna like it! I’ve had a response from Apple on this. They’ve said they don’t and never have provided a method for detecting hardware mute switch and don’t intend to do so. 🙁 IMO there is definitely value in … Read more

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

I found a much better way that works independent of the nav controller. Right now, I have this working when embedded in a nav controller, and when NOT embedded (although I’m not using the nav controller right now, so there may be some bug I’ve not seen – e.g. the PUSH transition animation might go … Read more

tech