objective-c

How do I properly create static NSArrays full of NSNumbers in Objective-C (Cocoa)?

Why is it that in the following code, I can not just simply make a static array of NSNumbers? I would just use C arrays and ints, but those cannot be copied and as you can see in init(), I have to copy the array to another one. The error I recieve is "Initializer element is not constant." It's very confusing; I'm not even sure what that ...

Difference between releasing object before and after [super delloc] statement?

Hi, I want to know what is the difference between before releasing my object of [super delloc] and after releasing my object of line [super delloc] For example, Before.. - (void)dealloc { [theAudioPlayer stop]; [soundFilePath release]; [theAudioPlayer release]; [super dealloc]; } Now after releasing object.. - (v...

UIScrollView Vertical Pan Snapping to top or bottom of view

Hi Guys, I have an image that is 320x480 and upon orientation change this image obviously hangs out of view. There are some images where the focal point of it sits with it's bottom cut off (which isn't undesirable). My issue however is when the user pans vertically to see the full image, the view appears to snap to the bottom meaning th...

what is the program flow in Cocoa Applcation

Hi, I am new to mac os X development ,I downloaded an open source mac application ,but i couldn't able to understand the flow of execution of cocoa program.so any one can explain the program flow of a general cocoa program briefly. Thanks in advance ...

upload plist file on server in iphone

hi, i have created a plist file other than the default one that exists. Can i upload this plist file onto the server I tried ASIFormDataRequest. I was able to upload the image and text file but when i try it with plist it throws error at point shown in bold: Code: networkQueue = [[ASINetworkQueue queue] retain]; NSString *filePath =...

custom NSSliderCell

Hi guys, I've sort of accomplised implementing a custom slider cell that can draw over using images for the scroll bar and knob. The only obstacle that is in the way now is this, when I drag the knob quickly, the images get messed up. i've posted a screen shot. http://img818.imageshack.us/img818/1730/duhm.png Here is the code: #import ...

objective c losing NSDecimalNumber value when accessed from another method

I am parsing Json Data into an NSDecimalNumber as follows product.Price = [NSDecimalNumber decimalNumberWithDecimal:[[jProduct objectForKey:@"Price"] decimalValue]]; This is in a loop with each product being added to an array. At the end I release the json object. If I Log the value of product.Price during the loop the value is corre...

iPhone UIPickerview reloadAllComponents does not work

Hi, I have UIPickerView component that receive data from its datasource (NSMutableArray) which is populated from sqlite. When user click on button new data row is added to databse. Now I need to reload UIPickerView to display fresh data from datbase. I know that I need to use method [storedDataPicker reloadAllComponents]; somehow but I ...

NSArray problem with addressbook

Hi, I have implemented an addressbook, I don't know what I do wrong, but whenever I select an address my whole app crashes and i receive the error > 2010-10-21 11:57:13.922 ANWB[2989:207] > *** Terminating app due to uncaught exception 'NSRangeException', reason: > '*** -[NSCFArray objectAtIndex:]: > index (0) beyond bounds (0)' > 2010...

UIPickerview reloadComponent

Hi, I'm developing a three component pickerview where the labels in each component very according to the selection of other components. The problem I have is that the labels will change, but only after the component has been turned ie. it doesn't change immediately as I thought it would when the code is executed. How can I get the labe...

CGContextDrawPDFPage leaking in iPhone 4 but not in iPad

I'm porting my iPad app to iPhone. Using the same code, CGContextDrawPDFPage is registering leaks in Instruments when running in iPhone, but not when running in iPad. I find this really disappointing because http://www.openradar.appspot.com/radar?id=126402 says CGContextDrawPDFPage leaks should already be fixed. Does anyone know the re...

Problem in Managing the reordering og rows in UITableView

Hi I have refered "Managing the reordering of rows" in "UITableView Programming Guide". I have written the same code for my application for rearranging the rows of tableView but not able to rearrange the rows in tableView. The delegates "canMoveRowAtIndex" and "moveRowAtIndex" have not been called though I set tableView in editing mode ...

Pointing a pointer to another pointer - what happens ?

Hi all, Wonder if anyone can clear up the following for me. What happens if I point a pointer to another pointer ? E.g Pointer 1 = Object Pointer 2 = Pointer 1 What if I then change pointer 1 : Pointer 1 = Object 2 Where does pointer 2 now point ? Thanks, Martin ...

NSInvocationOperation Question

Hello all, I would like to know how to remove duplicate nsoperations, i.e is there a way to check the nsoperation queue and see if I am making a duplicate request? Basically, I am requesting images depending on the iphone screen rotation. When the view is loaded the shouldautorate is called twice. If(rotation==portrait){ request ...

Overriding a variadic method in objective-c

When subclassing in objective-c, how can I forward a call to the superclass in the case of a variadic method. By what should I replace the ??? below to send all the objects I got? - (void) appendObjects:(id) firstObject, ... { [super appendObjects: ???]; } ...

UIPOPOVER for Iphone? or is it fake ?

Can anyone take a look a this ? : http://www.woowoomac.com/storage/awesome-note-iphone-note-todo-app-menus.jpg?__SQUARESPACE_CACHEVERSION=1268581762429 As we know iphone 4.0 does not support UIPopovers - any idea how did they manage to create a pop over like that ? ...

iPhone GPS problem simulator doesn't react

Hi, I am trying to create simple GPS application just to display simple data in simulator. I have no errors just cant obtain data. "didFailWithError" method is the only I can get to work :), this is the code: - (void)viewDidLoad { [super viewDidLoad]; lm = [[CLLocationManager alloc] init]; if([CLLocationManager locationServicesEn...

Display tooltip on UITableView in iPhone

Hi All, I was wondering if anyone has tried it. I need to show a tooltip within a table view when the user selects a word in the row's text. Can you please help me or suggest any way for this? Thanks in advance!!!!!! ...

memory leak with UITableViewDataSource data?

Hi i have found a problem with my DataSource of my UITableView. Each time i try to fill the NSMutableArrayData in the method "addDataSection", the whole data-Array is set to the current Names-Array. It all seems to work, until i write the Names into the Array and invoke [Names removeAllObjects]. Even in the method "addDataSection" my Na...

Getting data from google and displaying the address of the location in uitableview in Xcode.

how to display the addresses of a location lets say a restaurant chain on a tableview by getting that data from a Google in Objective-C (Xcode). ...