objective-c

ViewDidDisappear does not get calling in Ipad Apllication?

I have used following code to insert new view in split view based application DelegateObj.splitViewController.viewControllers = [NSArray arrayWithObjects: FirstObj.navigationController,SecondViewControllerObj, nil]; Similarly when i want to come back I Popped view from 1st object and inserted ThirdViewControll...

How do I get a UITextView to use /n characters in strings as new lines?

How do I get a UITextView to use /n characters in strings as new lines? For example, I want the string "Hello world!/nHow are you?" to appear in the UITextView as: Hello World! How are you? But it instead appears as: Hello World!/nHow are you? ...when I write myTextView.text = @"Hello world!/nHow are you?" ...

Invalid context when rendering with CIContext

I have a NSView that renders some CoreImage stuff in drawRect: method. Everything works fine while I'm rendering on hw-accelerated context, but if I switch to software mode, I have error messages in console for each render: <Error>: CGBitmapContextGetBitsPerComponent: invalid context 0x1084740 This isn't a bitmap context. Forcing destin...

Determine the CTLine containg specific character + Core Text + objective c

I am developing an Application in which I am using CoreText for layout purpose. I have used CTFrameSetter to draw the text.I have inserted a blank character '\ufffc' in my text. Now what i want is to determine the position of this blank character i.e. its x, y coordinates. I have not been able to find any function to determine the positi...

Advanced iPad programming

I finished learning the Big Nerd Ranch Guide to iPhone programming but now I need a more advanced book for advanced concepts particularly for iPad App Dev. Could you please recommend one? ...

How to compare a string within a another string?

How to compare a string within a another string? Example: NSString *temp = @"english, french, japanese, chinese"; NSString *jap = @"japanese"; How do i compare the string "japanese" in temp with the string "japanese" in jap. Is there any function? Thanks in advance ...

Please help memory warning 1 then 2

Hey guys just a quick question: I have an app, it has multiple view controllers, who have 2 views each. one for portrait and one landscape. The delegate has all the actions in it. These are called from the view controllers The_Ride_Vol_1AppDelegate *mainDelegate = (The_Ride_Vol_1AppDelegate *)[[UIApplication sharedApplication] delegat...

Xcode Memory problem, unloading and loading views from delegate

Hey guys just a quick question: Overview: I have a basic magazine app, it has multiple view controllers, who have 2 views each. one landscape and one portrait view for visual reasons. The app delegate has all the actions in it. These are called from the view controllers using : The_Ride_Vol_1AppDelegate *mainDelegate = (The_Ride_Vol_...

DrawRect method slowing over time. Why?

I posted this elsewhere bus was unable to get help. So basically I'm trying to make it so the user can "draw" an Image onto a view. The way I'm trying to accomplish this is by every 9ish pixel of movement on the screen, I create a mask of the line drawn and then clip the image with that mask. It actually works beautifully at first, and...

free() call works on simulator, makes iPad angry. iPad smash.

Hello, My app is running out of memory. To resolve this, I free up two very large arrays used in a function that writes a framebuffer to an image. The method looks like this: -(UIImage *) glToUIImage { NSInteger myDataLength = 768 * 1024 * 4; // allocate array and read pixels into it. GLubyte *buffer = (GLubyte *) malloc(my...

iPhone: How to Place a Scrollview Inside of Tableview Cell

I want to put a scroll view inside of the table view cell. I have a number of buttons in one cell of table view and I need to scroll that cell to show the appropriate button. ...

Does anybody know how to access a remote sqlite database using objective-c?

I'm developing a simple macosx application and it needs to access a remote sqlite database (must be sqlite). I've been looking for an example on how to do it through ODBC (I don't know if ODBC is the best or easy way). Does anybody have any idea? Thanks! ...

Why does this statement about UIColor whiteColor evaluate to false?

Just testing something out....I'm trying to get the background colour of my view to switch when I shake it....but only if it is currently a certain colour. -(void)viewDidLoad{ self.view.backgroundColor = [UIColor whiteColor]; } -(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{ if(event.subtype ==...

Load a particular NIB based on tableview selection

I have an initial table view that I created as the initial menu within my app. Obviously each option will access something different including NIBs. Part of the constants for the menu options is the NIB. When each option is pulled from a PLIST, I also include which NIB I would like to be called upon. Am I missing something or am I just ...

multiple xibs help

If i want multiple view controllers for aesthetic reasons with 2 views each, what is the best way to call them and dismiss the view for memory performance from the app delegate, say the xibs are called p1 p2 p2 etc ...

accessing the parent of an object

I'm trying to call methods on the parent of my object by passing the parent in as property. But i keep getting this error: expected specifier-qualifier-list before 'Wheel' @interface Car : NSObject { Wheel *w; } - (void)doCarStuff; @end @implementation Car - (id)init { if((self = [super init])) { //w = [[Wheel al...

Iphone -ScrollView smearing the view and the text

Hi, I registerd for the keyboard show event, and implemented the method like this : -(void) KeyboardDidShow:(NSNotification*)notif{ if (KeyboardVisible) { NSLog(@"Keyboard is already visible"); return; } NSDictionary* info = [notif userInfo]; NSValue* value = [info objectForKey:UIKeyboardBoundsUserInfoKey]; CGSize keyboard...

iVars, With and Without self?

I am just curious about the role that self plays within an object. I understand that writing [[self dataForTable] count] refers directly to the iVar contained in that object. But if you miss self off and directly specify the iVar [dataTable count] how does that differ, what are you protecting against by using self, is it just to uniquely...

Ipad Split view controller

Hey guys is there any way when i rotate an ipad split view app that my view could take up the full screen instead of the menu or resize it. I like the portrait mode with the menu in the button. How would i go about doing this. Cheers ...

Should -dealloc do anything other than release memory?

I inherited an iPhone app at work and I'm new to Objective-C so I don't have my bearings just yet. I encountered code similar to this: - (void) dealloc { [[StaticObject sharedObject] showSomeDialog]; [super dealloc]; } I know this is frowned upon in other languages. My spider sense is going crazy looking at that code. Is th...