objective-c

Notifications for file system changed?

I'm implementing a free space on disk bar where while files are being copied, the free space bar updates. I need some way of being notified of file system changes. What's the best way to go about doing this? ...

UIAlertView causes crash in Release mode

If the Help option is activated in my app when the user goes to the camera I show a UIAlertView first with tips on how to take a picture: -(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { if (buttonIndex != [actionSheet cancelButtonIndex]) { NSString *selectedButtonTitle = [actionShe...

Cocoa Touch UITableView Data

I am working for the first time in objective c and have come across an issue that I have not seen an answer for. I am loading a set of data from a JSON data set and using it to populate a UITableView within a UITableViewController. First when the view is loaded (viewDidLoad) I populate the array with the JSON data from a URL. Next th...

Objective C - access BOOL ivar of void pointer to self

I have a thing that uses a SystemSoundID to play a sound, and then repeat with a C function being used as the sound completion callback, and the function is passed (void *)self (since it has to be a void pointer), and then I want to play the sound again if the alarmPlaying BOOL ivar of self is true, otherwise remove the sound completion ...

self "not a structure or a union" in a UIViewController class. Why?

I have spent a lot of time trying to figure out what the problem is... but with no success. My code is the following: ResultGoalViewController *resultGoalViewController = [[ResultGoalViewController alloc] initWithNibName:@"ResultGoalViewController" bundle:nil]; [self.goalNavigationController pushViewController:resultGoalViewController...

iPhone dev multi threaded, NSAutoreleasePool

I have a simple application that counts down to midnight and then plays a beeping sound over and over again and blinks the label showing the time. So the label blinking uses an NSTimer, while the beeping goes on its own Thread, so that the pure C function (for the system sound id completion callback) can use [NSThread sleepForTimeInterva...

Iphone popup alert message

I can't find this anywhere. I don't want to have to use the debugger everytime. How do I get print messages on the iphone. ...

UIWebView display locally stored website (HTML, images, Javascript)

I've looked EVERYWHERE for this, can't find anything. I basically need to store an entire website inside of my iPhone for some interesting reasons. Regardless I can't figure out how to display it correctly in my UIWebView. EDIT: I should clarify, I can load the original HTML file, and I have chagned all of the pathing to be local, excep...

Menu Items, Responder Chains, and NSViewController, Oh My!

I must be missing something simple, but I can't see it. First, the setup: DATreeView, a subclass of NSView DATreeViewController, a subclass of NSViewController MainMenu.xib has an instance of DATreeViewController, which is configured to load a view from DATreeView.xib MainMenu.xib also has an instance of DendreaAppDelegate, which has ...

NSString to equation

Hi, I am using Objective-C and I am trying to set an equation that is stored in an NSString to be evaluated and stored in an NSInteger. something similar to the following: equation = [[NSString alloc] initWithString:@"1+5*6"]; and then evaluate that to become 31 and store it into an NSInteger. any ideas how to do this? ...

Finding touch point in Objective c/cocoa touch

I have a problem to find the touch point. I have a function loadView() where I set 16 tiles(16 UIImage View). Then In function: - (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { // Retrieve the touch point UITouch *touch=[[event allTouches]anyObject]; CGPoint point= [touch locationInView:touch.view]; ...

I have to show the value of the UISlider with it I didnt find any method in UISlider to do so.

I have to show ths slider values with the movement of the slider. Is there any existing function I can use. Coz I was trying to get a method other than placing labels to show the updated value along with the slider. Is there a way to show uislider value with slider? or if any other way please reply. ...

Drow-down menu In objective c/Cocoa touch

I want to display a dropdown menu consisting alphabel(A...Z) when i click on a image. Is it possible in objective C. Or there any better approch??? ...

Retain Count & Copy In Setter?

This is a followup question from a previous question, which is hopefully a little clearer. I am just curious how the code presented below is working, specifically is the variable myString getting released. It does not look like it is from the output? CODE // IMPLEMENT @implementation CelestialBody - (void)setName:(NSString *)newName{ ...

uiimage draws vertically flipped?

I am creating a drawing application in iphone.i have subclassed uiview to show selection rectangle.here is an image for this.... but when i create a rect using touch points. and when modify uiimage it just modifies vertically flipped.tried CGContextScalCTM with CGContextTranslateCTM but nothing happens.unable to figure it out.does som...

Why does a readonly property still allow writing with KVC

I'm working through the "Key Value Coding" chapter in "Programming for Mac OS X". I've built an interface with a slider and a label, both bound to fido, an int. If I set the property for fido to readonly, moving the slider still causes the label to change it's value. I had assumed that I'd get some sort of error for this. If the property...

How do I display more than one page from a PDF?

Hello I want to make an application in which I have to display pdffile on iphone screen, which has a functionality of zooming. I have multiple pages of pdffile, but the problem is i can get display only one page. Here is the code : /*myView.m*/ @implementation MyView - (void)configureTiledLayer { if([global getfirsttime] == 0) ...

Returning errors in objective-c

Im newish to objective-c and am starting to wonder what is the common/standard/proper way for handling and catching errors? It seems like it might be possible to use NSError to do this, is that a good idea or a hijack of cocoa? ...

Ok to release a pointer thats nil?

If I create a new object that includes two object pointers (see below) when the object is created the pointers are set to point to nil; @interface rocketShip : NSObject { NSString *name; NSNumber *thrust; } If (for some unexpected reason) I don't assign these pointers and later release them in my dealloc method is that ok, I ...

Binding NSSlider to NSTextField with nil minValue?

I have an NSSlider bound to a text field to display the value given by the slider. Everything works, but I would like the NSSlider to send "nil" as minValue to the object. For example, I can convert it to nil when saving (to a propertylist): if ([myOb intValue] > 0) [myDict setObject:... forKey:...] But I would like to apply sa...