objective-c

iPhone: Free developer certificate just for learning

Hi, i was wondering if i can get a iphone developer certificate for free? I just want to learn objective-c and iphone development. // No, the xCode iPhone Simulator don't have an accelerometer etc. g. ...

XCode 3.2.1 doesn't show contents of NSMutableArray when debugging?

I am struggling to understand why the following code doesn't show an array with any contents when I debug in XCode and yet the NSLog clearly displays contents, as does GDB using po? - (IBAction)action: (id)sender { NSMutableArray *btnTitles = [NSMutableArray arrayWithObject: @"Open in Safari"]; NSLog(@"%@",[btnTitles description]); // ...

Access IBOutlet from other class (ObjC)

Hi, I've googled around and found some answers but I didn't get any of them to work. I have one NSObject with the class "A" and a second class "B" without an NSObject. In class "A" are my IBOutlets defined and I can't seem to figure out how to access those outlets from class "B"... I've found answered questions like http://forums.macru...

Event name when IBOutlet is assigned in the controller

I would like to run some logic in my Controller class once all IBOutlets get assigned. What method do I need to override in the Controller class to receive this event? Thanks, Rui ...

Getting the number of rows in an NSOutlineView.

How would I get the total number of rows in an NSOutlineView? ...

Problem: AlertView must open subview but close it

I have a View that must open a subview if you click "Open Store" in a AlertView, but the subview is open, and after 1 sec closed again. Where is the problem?? This is my code: //my alertview UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"You must buy this item to use it!" deleg...

Using c library in objective c

I'm having trouble creating this c struct in objective c. typedef struct huffman_node_tag { unsigned char isLeaf; unsigned long count; struct huffman_node_tag *parent; union { struct { struct huffman_node_tag *zero, *one; }; unsigned char symbol; }; } huffman_node; ...

'initializing' a property which is retained

In the iPhone objective-c world, I've seen this pattern everywhere and I use it myself all the time without really understanding what is going on: In Test.h @interface Test: UIViewController { NSMutableArray *testArray; } @property (retain, nonatomic) NSMutableArray *testArray; And in Test.m @implementation Test @synthesize testA...

Drawing a convex shape with CoreGraphics

I am trying to create a right triangle with a convex hypotenuse. Start with a square Cut off half of it diagonally such that what is left is a right triangle. Curve the hypotenuse inwards How would I achieve this with CoreGraphics? Should I inscribe an ellipse over half of the rectangle? ...

How to get file names under a given directory in iPhone?

Hi all, I have some audio files saved under the Documents directory. I just want to get those file names so that I can display them in a tableview. Right now I'm using NSArray* files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:DOCUMENTS_FOLDER error:&err]; How can I extract just the file names i...

Pause mpmovieplayercontroller programmatically - is it possible?

Pause mpmovieplayercontroller programmatically - is it possible? tnx. ...

Overriding drawRect: and pushing new offset CGContexts onto the stack

I have overridden the drawRect: in my UIView and I want to draw several tiles. I'm looping through them all and I have a separate function that draws each individual tile. The way I'm doing it now is I pass the tile's calculated CGRect to the function. At the moment, any drawing methods have to include the x & y offsets of the rect pass...

Determining value of NSUInteger

I'd like to view the value of an NSUInteger at any given time. I assign the value below: NSUInteger test = -1; Then try to view it in the debugger: (gdb) po test Cannot access memory at address 0xffffffff (gdb) p test $1 = 4294967295 Current language: auto; currently objective-c Far as I know, it is a value type. Where is -1? ...

static NSString usage vs. inline NSString constants

In Objective-C, my understanding is that the directive @"foo" defines a constant NSString. If I use @"foo" in multiple places, the same immutable NSString object is referenced. Why do I see this code snippet so often (for example in UITableViewCell reuse): static NSString *CellId = @"CellId"; UITableViewCell *cell = [tableView dequeueR...

Drawing text in a NSButton subclass - positioning

I Have a custom button: And I need the text to be centered, here's my code: NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [style setLineBreakMode:NSLineBreakByWordWrapping]; [style setAlignment:NSLeftTextAlignment]; att = [[NSDictionary alloc] initWithObjectsAndKeys: style, NSPara...

Deleting a selected NSTableView row from Core Data?

How would I delete selected NSTableView row and it's corresponding Core Data entry? ...

Objective-C: Hierarchical passing of CoreData in NavigationController

Hi guys, I need some guidance with this issue I have. I have a navigational Controller, with the root controller making use of CoreData and an NSFetchController. Now, the root controller works fine. When I click on an item, hierarchically it should display the next UITable associating the values for the row in the previous root controll...

iPhone Objective-C Basic Example Question (about Properties)

Sorry I couldn't give a more descriptive title. My question (after looking at the code below) is what statusText is. Is it an IBOutlet or a UILabel? How does "@property (retain,nonatomic) UILabel *statusText" work? Does that statement mean that statusText is a property??? Thanks for answering. If there are any questions, please feel fre...

How does one properly cache/update data-driven iPhone apps that use remote databases?

My app is highly data driven, and needs to be frequently updated. Currently the MySQL database is dumped to an xml file via PHP, and when the app loads it downloads this file. Then it loads all the values in to NSMutableArray's inside of a data manager class which can be accessed anywhere in the app. Here is the issue, the XML file prod...

Error: Incompatible types in initialization? (iPhone,Objective-C)

I'm getting the error on "float pos = [sender value];"...sender should be a UISlider that I set up in Interface Builder. ButtonViewController.m - (IBAction)slide: (id)sender { float pos = [sender value]; loadValue.progress = pos; } ButtonViewController.h @interface Button_Fun4ViewController : UIViewController { IBOutlet UIProgres...