objective-c

App Crashing in NSURLConnection

Hi all, I am trying to figure out what is causing this crash. I have built and given the app to our testers but we cannot seem to reproduce this reliably. It just happens sometimes... Thread 0 Crashed: 0 libobjc.A.dylib 0x000027da objc_msgSend + 18 1 Foundation 0x00032896 -[NSURLConnection(NSURLCo...

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? ...

Returned Date as a string timestamp (Unix?) not sure

I'm working with some videogame server data. The server returns a dictionary with past game details. One of the fields is for the date. That returned object is a string like this: /Date(1286749014000-0700)/ I'm not exactly sure how that string translates into the date, but it should represent Sunday, October 10, 2010, 3:16 PM. Is...

Objective-C's dynamic advantages in Cocoa development?

So from my understanding (one of) the biggest allures of Obj-C is the dynamic, message-passing runtime. How's this and other features overall beneficial to Cocoa development? Why was Obj-C used for Cocoa dev and not C++/C? Basically I'm trying to understand how such language features are actually beneficial in terms of when actually...

Variable UIImageView

I have a working UIImageView, but I want to change it based on a certain variable so I have this: a string called imagevariable(which holds the value of image1 which is a png resource in my project). So I have this: imageView.image = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"imagevariable" ofType:@"png"]...

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? ...

Good Core Data tutorial?

Hey, Is anyone aware of a good detailed Core Data tutorial that focuses only on using the code (i.e. no IB involvement)? I've read the CD tutorial in the Xcode docs, and watched a few podcasts, but nothing really went from ground up. Any help is appreciated. ...

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? ...

applicationDidFinishLaunching - not triggering

Here is my code: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSRunAlertPanel(@"", @"", @"", @"", @""); } I have this, just to test it out, and for some reason, the NSRunAlertPanel is not triggering after the app starts...this is a problem because there are many "init" things that are necessary for my ap...

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? ...

Apply animation in specified UIView?

I want to make an animation like SwichView example in "Beginning iPhone development". My animation code: [UIView beginAnimations:@"View Flip" context:nil]; [UIView setAnimationDuration:1.25]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRi...

UINavigationController releasing bonanza

At the end of this code: UIViewController *viewController = [[UIViewController alloc] init]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; [viewController release]; [self presentModalViewController:navigationController animated:YES]; [navigationController relea...

Dynamic creating uiimageview

For my client i get the images from the server and store it in local directories and get the images . in that server they add images while they add images my app dynamically create image view an store images in that imageview...... then i want to get file names of that images.... ...

How to change the behaviour of enter key in UIwebview?

i have a login page,in that after entering password when i hit 'enter' key login should occur.above said condition works in browsers like chrome,firefox,safari but not in iphone simulator.In that when i hit 'enter' page reloads.plz help... ...

Best Design Practices if there are more than one views in an Application

Hey champs, This question is for iPad apps designing. I searched a lot on this very useful site but i didn't find anything related to the question. Suppose my application needs to present multiple views to the user, then what is the best way to do that. The ways i think that are possible are 1) Use only one view controller and add all...

Given a UTI (Uniform Type Identifier), find all types to which it conforms.

I am writing an application that makes use of Uniform Type Identifiers. Specifically, I am calling UTTypeCreateAllIdentifiersForTag() and passing it various MIME types. My hope was that this function (as distinct from UTTypeCreatePreferredIdentifierForTag()) would give me the most specific UTI as well as all the UTIs to which it conform...

Problem with No Network alert message

Hi all, I am implementing a web service calls based application. In that I am using a library to find out is the network available or not. If Network not available I displayed an alert. But my problem is some timer it showing another alert instead of showing my alert. The alert is like this 'No Network available'. But I didn't use this ...

play a tick sound when one second completes.

I am creating an application,in my app i am changing images for countdown. I want to play a Tick sound when one second completes(i mean when image changes).I have a 25 second long sound with repeated tick sound and within time interval of 1 second. I am new to use sound. can anybody provides me step by step solution for adding sound ? ...

How do i set section titles to work with UITableViewStyleGrouped?

I set my tabe view to use UITableViewStyleGrouped in IB and the cells look fine, but the section headers still look like they are in UITableViewStylePlain. They are over on the left and position does not not match with cells and they do not scroll when I scroll the cells in the view. I used - (NSArray *)sectionIndexTitlesForTableVie...

iPhone and Mac fonts problem

Hello guys! I try to use Helvetica font with size 13 pt. I have a problem, because I created an image with some text with this font and font size. Added it to my iPhone project, then I created a UILabel, added top on this image which was created in photoshop, I've used the same font and font size and it's totally different. Why is that?...