cocoa-touch

Deleting breakpoints in Xcode

There are some breakpoints in my project that for some reason can not be turned off or deleted. How can I delete these? I heard that they can be deleted by deleting a file with the extension .dsk, but I can't find that file. Where is it? ...

NSString does not have to be released in cellForRowAtIndexPath: method?

In order to set cell.textLabel.text in the cellForRowAtIndexPath method I alloc and init a string. If I release this string after setting cell.textLabel.text, then the program will crash after doing this several times. Why doesn't it crash the first time? Since the string was alloced and inited, doesn't it have to be released? Here's t...

How to find out if the back-button was tapped in the UINavigationBar?

Firstly I have tried to manage it with the viewWillDisapper-method, but this not detailed enough for me. Is their an other solution? Also tried the delegate: - (void)navigationBar:(UINavigationBar *)navigationBar didPushItem:(UINavigationItem *)item but nothing happens. ...

How to scale up an UIImage without smoothening anything?

I want to scale up an UIImage in such a way, that the user can see the pixels in the UIImage very sharp. When I put that to an UIImageView and scale the transform matrix up, the UIImage appears antialiased and smoothed. Is there a way to render in a bigger bitmap context by simply repeating every row and every column to get bigger pixel...

Why is my CGGradient not working with a preset UIColor?

I have this working code: NSMutableArray *shadowColors = [NSMutableArray arrayWithCapacity:2]; color = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; // Declaration using components [shadowColors addObject:(id)[color CGColor]]; color = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.0]; // Declaration using components ...

tableview:cellforrowatindexpath with multiple cell types

when i build and analyze, i am told that cell never gets a value...which seems false by my logic, but then the app crashes trying to load the table. so...why come? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *Cell1Identifier = @"Cell...

Image not appearing in UIImageView

I have a UIImageView in Interface Builder connected to an outlet called imageView. The statement [imageView setImage: [UIImage imageNamed: @"xxxx.png"]]; displays an image successfully if placed in viewDidLoad, but NOT if placed in an action method in the same view controller. There's an NSLog in the action method so I know it's firing...

How to make an NSMutableString blank

If I have an NSMutableString containing a random string, then how do I remove all characters from it so that it becomes an empty string? ...

Change tableView.rowHeight according to length of cell.textLabel.text

Is it possible to have different cells to be different heights? In my tableView, I want to have cells adjust to how long the text within them is. So a cell with not much text will be the default height, but a cell with a lot of text in it will be wider so that it can show all the text in it. Is this possible? ...

How to have a UIBarButtonItem with both image and text

When I try to use an image for a UIBarButtonItem, the text isn't shown. Is there a way to show both the text and the image? ...

How to access cell.textLabel.text in tableView:heightForRowAtIndexPath: from tableView:cellForRowAtIndexPath:

In the tableView:heightForRowAtIndexPath: method I need to get the length of cell.textLabel.text in tableView:cellForRowAtIndexPath. How can this be done? ...

Is AVAudioSessionCategoryAmbient broken or is there something special...

Is there something extra that i need to do to get AVAudioSessionCategoryAmbient working? if i choose playback it works fine...which is fine, but i would rather allow background music. I didn't post code because it works perfectly well if i change my category, so what i really would like a list of the steps i need to take to make it work...

Trying to reuse variable to avoid abandoned memory

I've got a TapDetectingImageView class that is pertaining in memory after usage because I do not reuse it in my code. I change my code now to reuse it instead of re creating a new one each time. The goal is to configure that TapDetectingImageView object and put it in a view. I'll do it 8 times but with the code below, only the last one ...

How to present GKAchievementViewController so it will display 1024*768 in iPad?

I am displaying gamecenter achievements using [myRootController presentModalViewController:mAchievementsController animated:YES]; for iphone it is displaying modalView of size 320*480 But for ipad it is not displaying modalView of size (1024*768). How to present GKAchievementViewController so it will display 1024*768 in iPad? ...

Navigation between views

I have app with UITabBarController. First tab has UINavigationController and it is UITableViewController. I mean I have tabs at the bottom and in first tab I have a table with possibility to navigate to other views. After touching one of cells I call view with MKMapView if([indexPath section] == 3){ LocationDetailViewController *dvC...

Decode images in background thread?

Hello! I have a background thread that loads images and displays them in the main thread. I noticed that the background thread has almost nothing to do, because the actual image decoding seems to be done in the main thread: So far I’ve tried calling [UIImage imageNamed:], [UIImage imageWithData:] and CGImageCreateWithJPEGDataProvider ...

MPMusicPlayerController not posting notifications?

I"m trying to use the MPMusicPlayerController to play music, and I also want to receive the notification MPMusicPlayerControllerPlaybackStateDidChange. I set up my player and notification registration pretty much just like the sample (which works, BTW - it receives notifications correctly): - (id) initWithPlaylist:(MPMediaPlaylist*)lis...

Relationships in CoreData

I am quite new to core data I have read a couple of articles on Apples dev site & now am somewhat confortable with using it with one entity. Now I am working on an app that recommends recipes to users. The datadesign is somewhat like this I have these entities Item , Pantry & Recipe . Relations are as follows: ...

How to associate a method with this button?

I have a navigation bar button that displays both image and text. This is the code: UIImage *saveImage = [UIImage imageNamed:@"star.png"]; UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeCustom]; [saveButton setBackgroundImage:saveImage forState:UIControlStateNormal]; [saveButton setTitle:@"Save" forState:UIControlStateNor...

Set the maximum zoom scale on a UIImageView ?

Is there a way to set the maximum zoom level on a UIImageView? ...