Using In A Project

Good Resources http://www.raywenderlich.com/12139/ The Podfile An example podfile with the ios target platform and one library version number specified and another library version not specified: platform :ios, '5.1' pod 'BlocksKit',      '~> 1.8.3' pod 'Reachability'   Updating The Pods Controlled Libraries Run Applications > Utilities > Terminal Navigate to your projects directory.  E.g. right click […]

Read More

Installing Cocoapods

How To Install Cocoapods Appliations > Utilities > Terminal sudo gem install cocoapods pod setup If it fails due to "Failed to build GEM native extension" ensure the xcode Command Line Tools are installed: In xcode close any open project, then Preferences > Downloads > Components and click the download down arrow icon next to […]

Read More

Running In Background

Your app can request the system to let it run in the background. Once you have doen this you can check the UIApplication's property called "backgroundTimeRemaining". This is usually 11 minutes (but may change in the future).   Apple Guide "App States and Multitasking" Lock Button Pressing the Sleep/Wake button causes the system to disable touch […]

Read More

Can we connect

Get A Small File Method This test will lock up if there is WiFi but no internet connection: if (![self.reachability isReachable]) This works much better as it tests the connection to an actual file on the server you want to connect to (assuming you can get a named file from it) and allows you to […]

Read More

Working With Strings

  URL Encode A String NSString *UrlEncodedString = MyStringToEncode stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];      

Read More

Read JSON File

Read the JSON file Get the File //Get file on a background thread to stop GUI locking up dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@”http://mydomain.com/comefile.php”]]; //Could obviously be a .json file too [self performSelectorOnMainThread:@selector(fetchedData:) withObject:data waitUntilDone:YES]; });   File Received //**************************************** //**************************************** //********** JSON FILE RECEIVED ********** //**************************************** //**************************************** – (void)fetchedData:(NSData *)responseData { […]

Read More

Run a synchronous method in a background thread

Running a synchronous method in a background thread is a great way of avoiding GUI seeming unresponsive to the user. Getting a file example Get a file //Get file on a background thread to stop GUI locking up dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@”http://mydomain.com/comefile.php”]]; [self performSelectorOnMainThread:@selector(fetchedData:) withObject:data waitUntilDone:YES]; });   File Received //*********************************** […]

Read More

Constants

    String Constants In your .h file extern NSString *const MyKey; Your declaration NSString * const MyKey = @"12345";    

Read More

-Dev Center Basics

Keychain access stores the main certificates. The Xcode Organizer stored provisioning profiles which rely on the certificates in keychain access. If a provisioning profile has a message like "valid signign identity not found" then you don't have a valid certificate for it in Keychain Access.  Remember that you must have the private key for certificates […]

Read More

-Dev Center Certificates

You Need The Private Key!!! You can't just download a certificate someone else created or that you created on another computer.  If you don't have the private key the certificate was created imported into Keychain Access with it won't work!  Helpfully, keychain access wont tell you this but when you click on the downloaded certificate Keychain […]

Read More