Posts

Showing posts with the label Cocoa Touch

Adding Custom Fonts To IOS App Finding Their Real Names

Image
Answer : Use +[UIFont familyNames] to list all of the font family names known to the system. For each family name, you can then use +[UIFont fontNamesForFamilyName:] to list all of the font names known to the system. Try printing those out to see what name the system expects. Example code: static void dumpAllFonts() { for (NSString *familyName in [UIFont familyNames]) { for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) { NSLog(@"%@", fontName); } } } Put that in your app, call it, and see what you get. If you see a name in the output that looks appropriate for your font, use it. Otherwise, perhaps you haven't properly added the font to your app. In swift 4.2+ use code given below: func dumpAllFonts() { for familyName in UIFont.familyNames { for fontName in UIFont.fontNames(forFamilyName: familyName) { print("\(fontName)") } } } ...

"Cannot Connect To ITunes Store" In-app Purchases

Image
Answer : Make sure you have signed out of any production iTunes accounts on the device. I was getting this error on my test phone which was logged in with my actual iTunes account. You cannot test apps using your production iTunes account, hence the error. I just wish Apple provided a better error so as to avoid this guesswork... see In-App Purchase FAQ: Cannot connect to iTunes Store Your app is running in the Simulator, which does not support In-App Purchase For testing in app purchases always use real devices. For newcomers, make sure your in-app purchasing product's status is Ready to Submit , with no "missing metadata". In my case, what was missing was the localization of the subscription's group.