objective-c

iPhone: Need a non-center point in one map always be the same location as the center of another map?

Hi there- think I may need an iPhone guru with some math skills for this one. I have two map views on one page, call them map A and map B. When the user updates map A, map B gets updated automatically, and vice-versa... Where it gets tricky is that when the user updates map A (drag/swipe/zoom), I need map B to update so that the coord...

Problems retrieving a Struct from an Array

Hi, wonder whether someone can help me with the following one... I have a struct typedef struct { NSString *section; NSString *row; } myStructDef; that I fill and write from function parameters "value[x]" to an NSMutableArray iVar "Arr1" of NSMUtableArrays local "Arr2" using: myStruct.section = [NSString stringWithUTF8Stri...

HOM with Objective C

Hey, i am new to objective C, but i tried to use HOM in order to iterate over an NSArray and append a string to each element. here is my code: void print( NSArray *array ) { NSEnumerator *enumerator = [array objectEnumerator]; id obj; while ( nil!=(obj = [enumerator nextObject]) ) { printf( "%s\n", [[obj descriptio...

gdb: getting into a dictionary

hi, i saw this post today: http://stackoverflow.com/questions/112796/how-to-view-contents-of-nsdictionary-variable-in-xcode-debugger. i need to see the contents of a dictonary but i only know the "key"...is there a way i can spit out the details like a print_r in php? po gives me the object, but i would like to go deeper po 0x2027c0 NS...

[self removeFromSuperview] not doing dealloc

i have this in the superview: mySubView = [[MySubView alloc] init]; [self addSubview:mySubView]; [mySubView release]; then at some point later, in the sub view, this: [self removeFromSuperview]; when i debug it, i notice that the dealloc for the subview is never called, even though i'm fairly sure the reference count should be 0. a...

Pass struct as id possible?

I would like to execute a function which obtains a struct in an separate Thread but not sure how to pass the struct right. Having this: - (void) workOnSomeData:(struct MyData *)data; How to properly call: struct MyData data = ... ; [[[NSThread alloc] initWithTarget:self selector:@selector(workOnSomeData:) object: ... Using &data d...

Password.text how to compare with stored password in sqlite3

How can I compare a password.text to text password stored in the database ...

Require CoreTelephony framework examples.

Greetings everyone. Can any one has a working example for the CoreTelephony framework? I dumped all the CoreTelephony headers using class-dump and added them to "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework". Now I'm following the Erica's tutorial (http:...

How to stop protocols from generating warnings?

Hi, if I have a protocal defined, then it always generate a lot of warnings when compile. like @property (retain) id <SomeProc> value then in the code: [value class]; ... [value release] the compiler always complain it "may not have class or release defined". Is there a way to fix this? ...

Suppressing NSLog statements for release?

Possible Duplicate: Do I need to disable NSLog before release Application? I wonder if someone could help me setup a number of NSLog statements so they print to console when executing in "Debug Mode" but don't print in "Release Mode". I understand I need to add something like DEBUG = 1 to the debug config in Xcode but I can't ...

How do I build an app and framework on OS X 10.6 that can run on 10.5?

Here's my situation: I have the source code for a third-party framework that I want to include in my project. I'm developing on 10.6 but I want to support 10.5, so I have the base SDK and the deployment target set to 10.5. I can build the framework and the application, and the app runs inside Xcode and on the machine. However, it fails ...

UIView drawing problem.

Hi everyone, I have this big problem that i dont know how to fix. I have a UIView that i want to draw a scrolling background on. I am using NSTimer to update 30 frames per second but it seems to redraw one frame every 8 seconds. I am calling [self setNeedsDisplay] but it has no effect. I cant figure out why this is happening, does anyon...

Objective-C: updating UITableView with recursive function?

I am trying to re-call core-data in UITable using model view. I am in UITable in - (void)viewDidLoad method using getting some data from internet and setting them entities and showing them on UITable.It works normal ,but Now I am trying to use new addModel view and in this model view I can type user name in textfield and save it in ...

AVAudioPlayer only initializes with some files

Hi everyone, I'm having trouble playing some files with AVAudioPlayer. When I try to play a certain m4a, it works fine. It also works with an mp3 that I try. However it fails on one particular mp3 every time (15 Step, by Radiohead), regardless of the order in which I try to play them. The audio just does not play, though the view loadin...

UITableView don't react on a tap

I have a fully working grouped tableview. But when i just tap on a cell - nothing happens. willSelectRowAtIndexPath is not even being called. All outlets are set correctly, userInteractions are enabled, tableView is the only view on a page. Googling for hours made no success. Everyone has a selection feature from the begining and someone...

Representing Objective C Protocols on UML class diagrams

How should I correctly reference protocols on a UML class diagram? For example my ListViewController conforms to the UITableViewDataSource and UITableViewDelegate protocols... where do I put the cellForRowAtIndexPath or numberOfRowsInSection methods? ... in ListViewController where they are implemented or in something like this: ...

UIButton doesn't appear on UIToolbar

I have a UIToolbar where I have dragged a UIButton. When I set the button properties to Custom, and assign an image (or background image) the graphics don't appear. However, when I give it a custom text, the text will appear. Why is it that the images don't appear? ...

Problem with TTWebController… alternative view controller template for UIWebView?

I have a UIWebView with content populated from a Last.fm API call. This content contains links, many of which are handled by parsing info from the URL in: - (BOOL)webView:(UIWebView *)aWbView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; …and passing that info on to appropr...

Caching images in iPhone app

My iPhone app has a built in RSS reader. There are images and I'd like to find a way to cache them on the system but have the system manage the caching and eventual clean up. Is there a way of doing this? ...

Using UIButton to open a new view

Hi guys, I am just starting Objective-C for iPhone development and have hit a small problem. I am trying to use a UIButton in order to open a new view. So far I have got all the elements connected up in interface builder and have added a UIViewController subclass, I am just not sure what code I have to put in the method that my button...