iphone

NSNotification doubt?

hi, i am new Notification.what is the purpose of it... can we use [[NSNotificationCenter defaultCenter] addObserver without postNotification, If we can do it,how it is identified?what is the relationship between addObserver and postNotification?any one can explain in detail? ...

Objective-C Socket Streams "Bad File Descriptor" (IPhone)

I'm trying to create a simple IRC client, purely for fun and to try and learn a bit more about socket programming in objective C. So I've looked at some sample code and I have no idea why I can't seem to send or receive message upon connecting. Firstly I connect to the server using the following code: if (![urlString isEqualToString:...

NSXMLParserDelegate compile problem - iPhone SDK 30. vs 4.0

Hi My header file is defined like this: #import <Foundation/Foundation.h> @interface Warning: NSObject { In my .m file I do: NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url]; [parser setDelegate:self]; This compiles and works just fine under 3.0. If I try to compile with 4.0 I get this error: does not ...

What is the difference between (+) and (-) operator in obj c function

Hi i am new to iphone and starts to learning Obj c. i have notice the function definition, for some function we are using (-) and for some function we are using (+) Example: + (id)requestWithURL:(NSURL *)theURL – initWithURL: what the difference between those two operator / symbol's usage? thanks! ...

Save many-to-one relationship from JSON into Core Data

I'm wanting to save a Many-to-one relationship parsed from JSON into Core Data. The code that parses the JSON and does the insert into Core Data looks like this: for (NSDictionary *thisRecipe in recipes) { Recipe *recipe = [NSEntityDescription insertNewObjectForEntityForName:@"Recipe" inManagedObjectContext:insertionContext]; reci...

Toolbar and Textfield problem

Hello guys! I have an iPad project. In the project I have a toolbar and then I add a textfield on it. Here's my simplified code. - (void)viewDidLoad { [super viewDidLoad]; UITextField *pageNumbersView = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 100, 40)]; pageNumbersView.clearsOnBeginEditing = YES; pageNumbersView.bor...

International Assist on iPhone

Does anyone know if the International Assist feature on the iPhone works when dialing a number using the tel:// URL scheme from an application? For those unfamiliar, IA automatically prefixes the "+1" to US numbers when using the iPhone internationally. I know that this works when dialing from either the built-in Contacts or Phone apps, ...

Dynamically calculate frequency value?

Hi, In my app, I want to find/calculate the audio frequency as dynamically when i am recording an audio and no need to save, play and all. Now i am trying to do that with help of an aurioToch sample code. In that sample, inside FFTBufferManager class methods such as GrabAudioData and ComputeFFT,Here I am not able to find where they are ...

jQTouch animated table cell hight

Hi everybody, I am using jQTouch to show a table list. When a cell (really a <li> tag in jQTouch) is clicked, I would like to animate the height of the cell down to 0, then hide the element. I have tried using jquery.animate() for this, and it works on firefox/chrome/opera, but it is super slow on the iPhone. Does anyone have any id...

classes in obj.c

@interface MainViewController : UIViewController < FlipsideViewControllerDelegate >{ } I am quite new to object oriented languages & especially obj.c. I need to use addressbook framework within this class.Apple documentation suggests this code: @interface ViewController : UIViewController < ABPeoplePickerNavigationController...

what is the problem if program is crash, when click save button?

hi experts, I have a simple todo list embedded in my main app, I had established it in a separate project, then I add it to my main project carefully, everything is good but, when I write the todo and click save button the program is crash! what is the problem? my code: self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc...

How to distribute an iPhone app BEFORE the sale date without getting UDIDs or jailbreaking?

I've got an app that's approved by Apple and ready-for-sale, but we're holding off for a few days for press reasons. Anyone know of a way to distribute this thing to beta testers without dealing with UDIDs or jailbreaking phones? Does it matter that it's approved, can I just give select users a file without the provisional stuff? ...

How do I resize table view after resizing it's footer?

I have a UITableView with header & footer added with code following the pattern shown in Apple's recipes example so the code for the footer is... if (tableFooterView == nil) { [[NSBundle mainBundle] loadNibNamed:@"DetailFooterView" owner:self options:nil]; self.tableView.tableFooterView = tableFooterView; } The footer NIB contains n...

How to have CATiledLayer not block the main thread

I am implementing a CATiledLayer into a UIScrollView. In the CATiledLayer, I have a function to draw the layers like so: - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx { CGContextTranslateCTM(ctx, 0.0f, 0.0f); CGContextScaleCTM(ctx, 1.0f, -1.0f); CGRect box = CGContextGetClipBoundingBox(ctx); NSData *d...

error “EXC_BAD_ACCESS” in my programm

Hi, i have a problem. When i compile my program there isn't a error but, when i start it these retern with “EXC_BAD_ACCESS”. I looking for the error with the debug and i find it in these method but i don't understand where... Can you help me? Thanks and sorry for the english. PS:the program enters in the loop sometimes. -(void)updateM...

OpenGL ES 2.0: Object rotation problem

Hi everyone ! I know the following question have been asked many times on different forums, but after viewing different solutions, it still did not fix my problem, or maybe I did not get what they mean I am trying to model a pyramid using OpenGL ES 2.0 on the iPhone. I would like to allow the user to rotate this pyramid using the touch ...

one picker, multiple arrays for datasources - working fine but how ?

hi guys, I have a class with 4 arrays: tab_1,tab_2,tab_3 and tab_T. I set the picker's delegate and datasource to self (which is the class containing the arrays). The picker is called when textfields begin editing. I return NO in order to prevent the keyboard from being shown. I have a method animating the picker instead. Depending on...

Defining a Class in Objective C, XCode

Hello; I am new to Objective C, and am trying to write a class that defines a complex number. The code seems fine but when I print to the console, my values for instance variables are 0. Here is the code: // // ComplexNumber.h // Mandelbrot Set // // Created by Brett on 10-06-02. // Copyright 2010 __MyCompanyName__. All rights res...

iphone dev - Can UINavigationController animate part of the view?

My app is using a navigation controller and it has a navigation bar, a table view and an image on each view. Those elements layout from top to bottom with no overlapping. Now because I have the exactly same image for every view (a logo), is it possible to animate only the navigation bar and the table view while the views push and pop?...

Hitting the Done button does not dismiss the View of a MPMoviePlayerController on OS 4.0 beta

Hi All Hope someone can help me on this, on the old OS version 3.0 and down , hitting the done button one playing a Video would automatically dismiss the view, but now since we have to control the view appearance, hitting the Done just stops the movie but does not dismiss the view, I tried to check if it was linked to any notification a...