cocoa-touch

UIImage imageNamed giving EXC_BAD_ACCESS the second time

Hi all, I'm working on a game with a bunch of mini games. Inside one gameview, I have the following code: UIImage* img = [UIImage imageNamed:@"foo.png"]; someImage = CGImageRetain(img.CGImage); [img release]; someImage is of type CGImageRef, and this has no issues the first time. After the user loses the mini game (or exits), the gam...

Navigation Controller strategy with an Address Book picker

So I'd like to have a user select a contact using the People Picker and THEN enter some custom data once a contact has been successfully selected. Simple enough. My question is where is the best place for my <ABPeoplePickerNavigationControllerDelegate>?  Should I put it in the RootViewController which is the delegate to the view with th...

iPhone + CGAffineTransFormRotate(pi/2) + statusBarHidden:YES + presentModalViewController = 20 pixels of white space

I think the title is pretty descriptive: I perform all 3 of these operations on a view, the result is 20 pixels of white space along the left side of the screen (if holding the iPhone is landscapeLeft). I tried to fix it by performing a CGAffineTransFormTranslate(transform, -20, 0) That just "slides" the view underneath the whitespace...

Gif marker problem on google map

I am using Google Maps on iPhone and adding GIF marker all markers are rotating on map. One min it will rotate but after that it will stop rotating. Now the problem is that after some time marker will stop rotating. My map is refreshing every 5 second and it will add or remove marker form the map. GIF marker are gif image which is ro...

Why is detecting touches getting slower and slower?

In my game if I play a particular game for several times, my touches need more time to be detected. It stores all touches and then applies those touches all at the same time. Can anybody tell me what's the problem? In touchesBegan I wrote: if (CGRectContainsPoint([tapView frame], [touch locationInView:self]) && tapView.alpha == 1)...

jerky effect in the movement of objects

hi im trying to create a game in which few objects(UIImageViews) traverse the screen... these objects are generated at an interval of 1 to 0.45 seconds...when they r generating in the range of 1-0.60 seconds they traverse smoothly..but when they generate at a rate less than 0.6 seconds their movement is not smooth they start jerking..als...

UITextField changing font size via Interface Builder

I've been trying to adjust the font size for a UITextField that's embedded in a contentView of a UITableViewCell. I'm using cmd+T to bring up the font menu, and in there am using just the default font Helvetica size 18. Everytime I change the size it doesn't seem to make a difference at all when my UITextField is displayed. It's almost a...

How do I include a font with my iPhone application?

I've already seen this post: http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application which is helpful, but I'd love to simply load the font via: UIFont* font = [UIFont fontWithName:@"Harrowprint" size:20]; Some people have reported this possible but it's not working for me. Can someone confirm h...

Responding to touchesBegan in UIPickerView instead of UIView

I have a UIPickerView that gets faded out to 20% alpha when not in use. I want the user to be able to touch the picker and have it fade back in. I can get it to work if I put a touchesBegan method on the main View, but this only works when the user touches the View. I tried sub-classing UIPickerView and having a touchesBegan in there, b...

CATransform3D vs. CGAffineTransform?

Whats the difference between the two? I'm sure they have pros and cons, and situations they are better performers in. Any resources that compare the two? Is one better for animation (I imagine the CATransform3D)? Why? Also I think I read somewhere that text clarity can be an issue, is one better at scaling text? ...

Possible to "reset" a UIDatePicker's highlighted month/day/year?

I have a View Controller I'm reusing to edit individual objects (NSString, NSNumber, NSDate) in a previous View Controller's TableView. I'm loosely basing this off of the EditingViewController in Apple's SQLiteBooks sample project. the datePicker is instantiated in the nib file. The issue here is it works fine & dandy for the first dat...

how can I call a screen with a button action (xcode) ?

I am developing a Window Based app for iPhone. I use Interface Builder to build Interface. I want to call a new screen with a Button Action. How can I call the screen with Button action ? ...

What's the best way to communicate between view controllers?

Hi Stack Overflow Gang, Being new to objective-c, cocoa, and iPhone dev in general, I have a strong desire to get the most out of the language and the frameworks. One of the resources I'm using is Stanford's CS193P class notes that they have left on the web. It includes lecture notes, assignments and sample code, and since the course ...

Copying UITableViewCell

I'm reading a custom table cell in tableView:cellForRowAtIndexPath: from a nib file. This works great for my purposes, except it's quite slow. Now, I know the right thing to do in the long term is to create the cell entirely in code, and to use a single view, and so on. But this is a prototype, and I don't want to put that much effort i...

CALayer addSublayer increasing retain count?

I think that when I add a view as a subview like such: UIView* view = [[UIView alloc] init]; [self addSubview:view]; [view release]; that it's safe to release the view afterwards...is it the same for a CALayer object? If I create a CALayer using alloc/init, and do: [self.layer addSublayer:layer]; is it safe to do a release of the l...

NSDate and NSDateFormatter issues

I'm having slight difficult understanding why the following code is crashing an app of mine: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MMMM d, yyyy"]; NSDate *date = [dateFormatter dateFromString:cDate]; datePicker.date = date; NSString *dateStr = [dateFormatter stringFromDate:date];...

Cocoa: Can I purposely block in a loop to wait for an asynchronous callback to finish?

Apologies in advanced for my confusion. I'm trying to do a batch upload of photos in my iPhone application. I have one script that's looping through a user's photos, and then for each photo, calls another script to do the upload. The script that does the upload needs to call back the script that's firing off each of the user's photos to...

Memory management. Copy method

I use this code to copy and instance of my class //Create the copy and pass it onto edit controller PoolFacility *poolCopy = [self.thePoolFacility copy]; self.childController.thePoolFacilityCopy = poolCopy; [poolCopy release]; Now when I view the variables in the debugger, how come some of the class' fields have the same memory addres...

Truly modal UIAlertView in iPhone?

I'm need run a couple of validatins that depend on the decisions of the user (for example, if aprove a purchase above the spending limit), and deny the "done" action if it's fail. However, look like is not possible have a truly modal action like with other languajes (like showmessage, alert(), etc) and everything is by delegates. But t...

A shot in the dark - Application bug

Ok so this is gonna be a bit of a shot in the dark without you being able to see my application! I have a bug. I have a SwimmingPool class, my app passes the pool from a tableview into a detail view where you can see all the swimmingPool class fields. You can then click on the individual detail, edit it, and then save it. The 'original'...