iphone

Image not showing in iPhone Simulator

I dragged an image from the Media Library in my Interface Builder and can see the image in my xib. However, when I open up the iPhone Simulator the image isn't there. Do I need to put code into the program's .m or .h to be able to show the image I have on IB? ...

UIScrollView odd behavior: zoom in, pan, zoom out leaves content view uncentered

I have a custom UIViewController subclass controlling a UISCrollView containing an UIImageView, set up like so: UIViewController + UIScrollView (delegate: UIViewController, viewForZoomingInView: UIImageView) + UIImageView I can use the UIScrollView to zoom in on my image, and pan around -- but if I do so such that the center of the ...

iPhone SDK: How to copy the contents of a NSArray to NSMutable array?

I need to copy the contents of an NSArray to NSMutable array. In other words, I want to copy arrayCountryChoices to arraySearchResults. Any ideas???? //main data NSArray *arrayCountryChoices; //search results buffer NSMutableArray *arraySearchResults; //create data arrayCountryChoices = [[NSArray alloc] initW...

Where am I leaking CGMutablePathRef in this code?

In my code I have CGMutablePathRef thePath = CGPathCreateMutable(); If I don't release it I literally get thousands of leaks because I'm doing the action constantly. However, if I do release it, my game eventually crashes. Any ideas? Is it possible I'm releasing it in the wrong place? -(void)MoveObject:(int)Tag { representatio...

Singletons in Objective-C for storing and accessing program-wide variables. A few questions

Hi all! I am using Apple's MyGizmoClass Singleton class for program-wide "session variables" and loving it! However, when I run "Build and Analyze" it gives weird results. Maybe my usage is wrong (it works, but it may be working due to a flakey side effect). Here is an example. - (NSInteger)tableView:(UITableView *)tableView numberO...

iPhone:Learning Cocos2D project

Hello all, I want to learn and develop game using Cocos2D free project in a month. Learning Cocos2D is a bit hard and i don't know how to create my project initially same like Cocos2D project and use the files from Cocos2D project to my project. I doubt whether it is possible? Can i learn and use Cocos2D project itself directly and modi...

Add text to CALayer

Is it possible to add a UILabel to a CALayer without subclassing and drawing it in drawInContext:? Thanks! ...

How much VRAM on each iPhone/iPod model?

I know MBX model has limit of 24MB VRAM. How about SGX models? And can I assume all iPhone/iPod touch models have SGX or MBX at least? No other models? And how much memory bandwidth (to/from GPU) they have? ...

Incompatible type for argument 1 of 'bezierPathWithOvalInRect' error

Hi, I have the following code: - (void)drawRect:(NSRect)dirtyRect { [[NSBezierPath bezierPathWithOvalInRect:[self theRect]] stroke]; } - (NSRect)theRect { return NSMakeRect(1, 1, 1, 1); // made up some values } When I compile it says "Incompatible type for argument 1 of 'bezierPathWithOvalInRect' error". When I do this, howev...

UINavigationController: When Does a Pushed View Receive the Dealloc Message?

I would expect that after I push a view controller I then need to release my ownership of the view controller like I did below. CustomViewController *nextViewController = [[CustomViewController alloc] initWithNibName:@"CustomView" bundle:nil]; [[self navigationController] pushViewController:nextViewController animated:YES]; [nextViewCo...

iPad / iPhone Sync (WLAN or Inet)

I have actually one app with a SQLite DB and i port this at the moment to the ipad. My idea is a sync between iPad and iPhone for one table... But the Problem is "Person A" edit/change, create or delete a data record on iphone and "Person B" make the same or delete the edited record from Person A on the same time. Has anybody a idea for...

How do I limit an objects movement in xcode for iphone?

Hi all, this is my first ever question so apologies if it's not descriptive enough. I currently have an object that can be moved along an x axis with dragging. I need to limit it's movement to half of the screen. Can anyone help ...

iPhone app which is only a local HTML file, how?

I have a HTML Ajax website which consists only of one HTML file. How can I create an iPhone App out of it? The HTML file should be stored locally on the iPhone so it functions offline. ...

iPhone Fetch Request with localized sorting

I'm trying to get sorted localized data from a core data model. My code: NSEntityDescription *entityDescription = [NSEntityDescription entityForName: entityDescriptionValue inManagedObjectContext: context]; NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest s...

GH-Unit and "Undefined symbols" error

I'm using GH-Unit for my unit tests. I've set it up according to the instructions, but I'm getting an "Undefined Symbol" error on this line: #import "GHUnit.h" #import "ChecklistAppDelegate.h" @interface TestAppDelegate : GHTestCase {} @end @implementation TestAppDelegate - (void)testStoringProperties { ChecklistAppDelegate *appD...

Difference between creating a local variable and assigning to ivar and directly assigning to ivar?

Hello, I have always wondered why all apple code samples use code like this: UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController]; self.navigationController = aNavigationController; [self.view addSubview:[navigationController view]]; [aNavigationCont...

How to Change Background of UIWebView Scrolling?

in the iPhone SDK Interface Builder, any UIWebView has a default gray background that is shown when the view has been scrolled too far. Is it possible to change this background color so it doesn't look so obvious? The gray conflicts with my App :( Any help would be greatly appreciated. ...

MongoDB for C# and iPhone app

I'm in the initial phase of designing an application that will have a backend implemented in C# that will provide data for other platforms using WCF web services hosted on IIS. One of the platforms will the the iPhone. Since it's a personal project, I want to use it to learn MongoDB. I already know that there are community developed dri...

Making view transitions fast - do you use this hack?

I have an iPhone app that displays a modal view controller. The modal view controller shows two instances of a custom subclass of UITextView called RoundedTextView, an MKMapView, and a UIToolbar. I construct the viewController only once, and reset its data and present it each time the user summons it. When showing this view controller w...

How can I use scrollRectToVisible to scroll to the center of an image?

I have a UIScrollView with zooming and panning. I want the image to scroll to the center after a user command. My problem is in calculating the size and location of a frame that is in the center of the image. Does anyone know how to calculate the correct frame for the center of my image? The problem is that if the zoomScale is different...