objective-c

after dismissing modal view, parent view seems deallocated??

I'm writing an iPhone app. Starting from a view controller in a navigation stack [called EditCreatorController], I am presenting a custom modal view controller [called BMSStringPickerController]. I have created a delegate protocol, etc. per the Apple guidelines for passing data back to the first view and using that view to dismiss the mo...

Is object free / freed on dealloc and / or release?

I recently took an objective-c test to see how I would do. Turns out my score wasn't anywhere near as good as I hoped. That means more studying. During the test, I was asked this question: How do you free an object? A. [obj dealloc]; B. [obj release]; C. None of the above My choice was A, and I don't know if it's correct. The ques...

Manually rotating a UIView in response to orientation change? (Not AutoRotate)

I have an OpenGL view that I would like to manually modify and redraw in response to a device orientation change. How can I accomplish this? If I return YES from shouldAutorotateToInterfaceOrientation:, the system does its stock rotation animation, which I don't want. I just want to get a notification and then adjust my openGL scene to m...

NSTask sending an argument through /bin/sh or /bin/bash problem Cocoa Objective-C

Hello, Basically I've passed a script in the terminal through /bin/bash "[path]" or /bin/sh "[path]", and I've passed commands in a terminal through /bin/bash -c "[command]" or /bin/sh -c "[command]". Both ways work properly. But in my Cocoa App, when I try to do the exact same thing with NSTask (using /bin/bash or /bin/sh), the app see...

Closing panel in one source file from a separate source file

This is what I got so far. - (IBAction)HUDPanelDictionaryHide:(id)sender{ extern NSPanel HUDPanelDictionary; [HUDPanelDictionary close]; } This obviously does NOT work. The HUDPanelDictionary is declared in a separate .h and .m file for an .xib file. I need to close this panel from the other .h and .m file for another .xib ...

Return Inputs to UITextfield with custom inputView

i created a UITextField and a custom View. after that i added this custom view as "inputView" to my UITextField. amountKeyboardViewController *amountKeyboard = [[amountKeyboardViewController alloc] initWithNibName:@"amountKeyboardViewController" bundle:nil]; amountTextField.inputView = amountKeyboard.view; [amountTextField becomeFirs...

presentModalViewController not working properly

I have 3 views. I want to do the following: A presents B modally A dismisses B A presents C modally I have setup a delegate pattern where A is B's delegate. This is how I am presenting and dismissing in B: [delegate dismissB]; //this is just [self dismissModalViewControllerAnimated:NO] [delegate presentC]; //this is just [self prese...

objective c iphone pocket-audio template

Ok, I'm wondering if there are any iphone application templates that can send the mic input of the iphone wirelessly (wifi) to the computer. And then on the computer, there is another app the receives the mic input and makes it the audio input for the app. There is a decible meter on the mac app. This is similar to the already existing ...

Add a subview to a window, along with a specific key to toggle visibility?

I've figured out how to create a new UI element where I touch and add it using [self.view addSubview:[uilabel reference]]. However, if I tap in the same place, it'll simply add another subview on top of the current one. I am able to create a unique key for each part of the grid I'm making (and thus placing subviews). Is there any way I ...

overlapping text and images in iphone Table View cell

hi guys i am New to Iphone... i am developing Table View with image and Text but Over laps the image and text when with the old text i scrolls the table Can Any one help me... Here is my Code in cellForRowAtIndexPath... Thx in Advance... UIImage *img=[UIImage imageNamed:[imageArrray objectAtIndex:arc4random() %17]]; UIImageView *ivie...

Recommend class design in Objective-C

I'm new to Objective-c. For learning purposes I'm trying to build something like a phonebook. So I'll have a class called Person that will have some properties (name, phone, etc). Right now I'm not preoccupied about persistence. But, I need something to "hold" Person objects. So I thought about create a class called People, but I don't ...

How to add Button to userLocation callout?

How can I display a DisclosureButton in the userLocation (the blue dot) callout like the Apple Maps app does? Now I just can change its title and subtitle, but I hope to provide custom callout views. Therefore, if I click the blue dot, it can display a button besides only title and subtitle. In this way, when I click the button, it can...

storing adressbook contacts into a nsdictionary

hi, i'm still trying to wrap my head around using NSDictionaries, and have come into a situation where i believe i need to use one. essentially, i would like to store all the phone numbers associated with each contact into a dictionary. so far i have this: ABAddressBookRef addressBook = ABAddressBookCreate(); NSArray *thePeople = (NSA...

Calling a C++ class from within a view controller crashes

I have a C++ object that I'm getting the reference to in my view controller like this: m_applicationEngine = (ApplicationEngine *)[(GLView *)[self.parentViewController view] m_applicationEngine]; In my location delegate I call a methid in the class like this: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(C...

In objective-C, I have a NSString with one letter in it. How can I get the ASCII value of that letter?

for example: NSString *foo = @"a"; How can I get the ASCII value of this? (I know it is really 97, but how can I get it using Objective-C?) I guess I can convert it to char but I had no luck with that so far. Sorry for being too nooby! ...

Memory issue for global variable and class variable on iPhone/iPad/iPod touch

When we should use global variable and when class variable and why? I hope your experiences and ideas to share with us who are novice in this platform. Example: Let, i need to trace timestamp and position of touch events (eg. touch start, end) on a layer. I can trace it using global variable or class variable of the class which imple...

tableview crashing when scrolling

Hi, I'm dynamically inserting rows into a tableview. When I try to scroll in the simulator, it crashes with bad access memory. Any ideas? I populate the tableview after getting a notification that another event has occurred. -(void)populateTableView:(NSNotification *)notification{ NSMutableArray *eventArr = eventData.getEventListing...

How to determine a method is overridden or not from definition? (Objective-C/iPhone SDK 4))

How to determine a method is overridden or not from definition? (Objective-C/iPhone SDK 4)) ...

How to set up my iphone application with twitter

How to Set up my application with twitter and then register the application with twitter so that people can send tweets for my app. Please can anybody help me in resolving this problem ...

How do you draw vertical line using coreplot CPPlotSymbol?

Hi All, How do I draw a vertical line on plotSymbol using Custom PlotSymbol? If it would be grateful, give any samples regarding that. Sri ...