iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

NSExpression catch invalid arguments

I am using NSExpression to evaluate a mathematical string and it works great. However I want to have a way of catching an error when the input string is invalid, such as “3++2”. Is there a way to go about doing this instead of the application terminating due to ‘NSInvalidArgumentException’. Sorry, I am fairly new […]

FBConnect iphone : I coud'nt get Photos albums for some account ?

Maybe someone can’t help me. I use the last FBConnect ( for Facebook connexion. And I retreive the list of photos albums for the user. NSMutableDictionary* params = [NSMutableDictionary NictionaryWithObjectsAndKeys:_facebook.accessToken,@”access_token”,nil]; [_facebook requestWithGraphPath:@”me/albums” andParams:params andDelegate:self]; I’m testing with 4 differents account with all the same rules for privacy (Account/Privacy settings). And for some of them the […]

Number of Months and Days between two NSDates

I would like to calculate the number of months and days between two NSDates. I have the number of days calculating correctly, but how can convert that to months and remainder days? This is what I’m using to calculate total number of days, which is working correctly. – (NSInteger) numberOfDaysUntil { NSDate *fromDate; NSDate *toDate; […]

Lock all screen orientations to portrait except for 1

I’m developing an iOS app that can only be accessed in portrait mode. Except 1 framework (1 out of the 80 screens in my map) that I’m using needs Landscape support. Therefor I had to allow it in my plist. What is the easiest way of making sure all other views are displayed in portrait […]

Creating playlists in iTunes using Scripting Bridge in a Sandboxed app

Is this possible? In this question I saw that you add to the entitlements file: <key></key> <dict> <key></key> <array> <string></string> <string></string> </array> </dict> for read access. But how do you get write access? I looked in the documentation and they suggest the manual for sdef, but I couldn’t extract any information from this. Also, would […]

Overwriting UINavigationBar to set a default titleView

What I want to do is a navigation bar with a image on it. I have a tab controller on my main view, and inside each tab I have a UINavigationController. From inside the UIViewController that my tab/navigationController calls, I could set the titleView without much problem, doing this inside the viewDidLoad method: self.navigationItem.titleView = […]

Issue in viewing sqlite file created by Core Data in iOS 7

I have an issue when am trying to access the database file that is created by core data. The DB file is in Documents folder. I’ve copied this to my desktop and opened it using Firefox plug in. Hello.sqlite file doesn’t contain any rows that I have inserted values using core data. Am running app […]

How to convert an NSArray of NSManagedObjects to NSData

I’m new to Objective C and was wondering if anyone can help me. I am using core data with a sqlite database to hold simple profile objects which have a name and a score attribute (both of which are of type NSString). What I want to do is fetch the profiles and store them in […]

People Picker with ios 7, and ios 8

This question already has an answer here: ABPeoplePickerNavigationController changes with iOS8? 3 answers

How do I parse a basic XML file with NSXMLParser?

I am trying to figure out NSXMLParser for my iPhone app and while I generally understand how it works, I am still a little confused about how to extract the values I need. The XML result that I am parsing is very basic. it is like so: <start> <status>300</status> <record> <title>The Title</title> <content>Some content</content> </record> […]