cocoa-touch

Core-Plot: Unknown class CPLayerHostingView in Interface Builder file

Using core-plot does not seem to be an easy integration task. Header path are already setup. In Interface-Builder I create an CPLayerHostingView which belongs to a View Controller which is instantiated by Interface Builder. When the nib file is loaded I get the message: Unknown class CPLayerHostingView in Interface Builder file ...

Write simple data to iphone sandbox?

I want to write a small bit of data from my app to the iphone so I can load it when the app next starts. I am going to write the data using NSCoding, but I don't know what I should be specifying as a path. I understand I would write the data to the application sandbox, just not sure how to specify that. gary ...

applicationWillTerminate, delegate or view?

I am looking to save some settings when my application exits and I am a little confused about the 2 different versions below. My feeling is that to better fit the MVC pattern I should be using the version in the viewController. I am just curious as most folks don't seem to do much in the appDelegate when that call would be used? AppDele...

How can I get a core animation Explicit animation to behave in exactly the same way as an Implicit animation?

I wish to do some custom animation using core animation but am having the (no doubt) classic problem of animations resetting when they have completed. Of course this can be stopped by using: [animation setFillMode:kCAFillModeForwards]; [animation setRemovedOnCompletion: YES]; However, I am then left with a layer that won't respond to...

Custom Keyboard (iPhone), UIKeyboardDidShowNotification and UITableViewController

On an iPhone App, I've got a custom keyboard which works like the standard keyboard; it appears if a custom textfield becomes first responder and hides if the field resigns first responder. I'm also posting the Generic UIKeyboardWillShowNotification, UIKeyboardDidShowNotification and their hiding counterparts, like follows: NSMutableDic...

novice needing help on shuffeling an array

Please help a TOTAL beginner.! I found this post: http://stackoverflow.com/questions/56648/whats-the-best-way-to-shuffle-an-nsmutablearray And as i try to deploy this in my own code, I cant get it working... :-( Can anyone help me to resolve this code? To me it looks like the shuffle function is not called..? here is my code: // //...

How to call a method of a specific class from another class (created in this specific class) ?

I created a TTModelViewController. in the createModel Method i created a TTURLRequestModel. after Loading content in the TTURLRequestModel i want to call a method in my TTModelViewController. TTModelViewController - (void) createModel { requestModel = [[singlePostModel alloc] initWithId:@"54"]; } - (void)didLoadModel:(BOOL)firstT...

How to get a long url from a short url

I would like to determine what the long url of a short url is. I have tried using http HEAD requests, but very few of the returned header fields actually contain any data pertaining to the destination/long url. Is there: 1. Any way to determine the long url? 2. If so, can it be done without downloading the body of the destination? Tha...

Finding user location before map loads

I'm trying to find the user's location using: CLLocationCoordinate2D _location; CLLocation *userLoc = nil; if(appDelegate.clLocationManager.locationServicesEnabled){ userLoc = mapView.userLocation.location; _location = userLoc.coordinate; } The problem is that I haven't yet initialized the map so the above doesn't work. Is th...

How are *.xib, *.m and *.h files related?

How/where in the code does the nib file get related to its *.m and *.h files? Specifically I'm talking about when you create a new Objective-C class, not using the initWithNibName method. Wherever this relationship is defined is obviously used by the 'Files Owner' relationship in Interface Builder. I imagine it's a *.plist file somewh...

View Controller's viewDidLoad method finishing before applicationDidFinishLaunching

I'm creating a fairly complex iPhone app using Core Data. Up until now, things have been working fine. As the app has been getting more complex, however, a new problem has come up: the first view controller is finishing its viewDidLoad method before the AppDelegate gets even halfway through its applicationDidFinishLaunching method. The...

iPhone UIButton addTarget:action:forControlEvents: not working

I see there are similar problems posted here, but none of the solutions work for me. Here goes: I have a UIButton instance inside a UIView frame, which is positioned within another UIView frame, which is positioned in the main window UIView. To wit: UIWindow --> UIView (searchView) --> UISearchBar (findField) --> UIView (prevButto...

iPhone: How to Define and Use a Custom UITableViewCell from a Nib File.

Hi, I'm trying to create a single custom UITableViewCell from a xib, among other normal UITableViewCell's. I've tried quite a few varied things with no success. Can anyone help me please? ...

iPhone "touchesBegan" and "touchesMoved" message ... do not move to centre of touch

I am modifying the "MoveMe" example from the apple web site. When my controller gets the "touchesMoved" message it moves the object being moved to the centre of the touch, because (pseudocode) object.center = touch.center. How can I store the offset of the initial touch so that if I start the touch/drag to the side my finger will stay on...

Attributed strings in UITableViewCells without WebView?

Hello, does anyone know if there's a way in with 3.0+ to display attributed strings within a UITableViewCell without using a UIWebView for that? I need to display a string with linked, tappable substrings as the typical detailTextLabel. I wouldn't mind exchanging this UILabel against another type of view, but I think a UIWebView could b...

Converting NSMutableData to NSString Problem

initWithData does not convert my data object into a string properly. When I check the length of the data object, it has a value. NSMutableData* receivedData =[[NSMutableData data] retain]; NSString* json_string = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding]; Am I doing something wrong creating the st...

How do I set an ABPeoplePickerNavigationController's prompt?

This is the code I'm using to call the people picker, but the prompt label text doesn't change: ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; picker.displayedProperties = [NSArray arrayWithObjects: [NSNumber numberWithInt:kABPersonEmailProperty], nil];...

Where's the iPhone MIME type database?

I have a program for the iPhone that is supposed to be doing intelligent things (picking out appropriate icons for file types) given a list of filenames. I'm looking for the iPhone take on something like /etc/mime.types or something similar- an API call is what I'm assuming would be available for the phone. Does this exist? ...

CFNetwork / NSURLConnection leak

Running instruments on the device, I intermittently incur a memory leak of exactly 3.5 KB in CFNetwork, the responsible frame being "HostLookup_Master::HostLookup...." I have read a number of questions re this issue and have separately tried the following to fix the leak: Included the following in applicationDidFinishLaunching: NSURL...

Problem with UITableView within a View

I have a UIViewController subclass that implement UITableViewDataSource and Delegate. When a user triggers didSelectRowAtIndexPath I alloc init this second ViewController with presentModalViewController and set my class as a delegate. When the user finish working on the modal I notify the parent ViewContoller to save his data and dismis...