objective-c

Glow effect in UITextView

Can glow effects be applied on text inside UITextView? If so, how? ...

Cocoa - Loaded nib file disappears when focus is lost

I have a nib file I've loaded like so [NSBundle loadNibNamed: @"myNibFile" owner: self ] and it pops up fine, but when it loses focus, it simply disappears. I've checked to see if it's vanishing behind my main window but it's not. My app is pretty big so I'm not sure what could be causing it. I have garbage collection enabled if that mak...

Objective-C delegate coding practices

I have some coding practices involving delegates that I'm not sure of. First of all, if a delegate protocol has no optional methods (all required), is it a recommended practice to use respondsToSelector: to check whether the delegate object implements that method? And second, do I need to check whether the delegate isn't nil before calli...

Putting iPhone into Sleep Mode Programatically

Hi all, I had used the following code to prevent the iPhone from entering the sleep mode. [UIApplication sharedApplication].idleTimerDisabled=YES But is it possible to put the iphone in Sleep mode programatically ? Thanks ...

make array out of string with variable number of spaces in Objective-C

This is the code that I would use if it was always single spaces in between words. Since I have multiple spaces in between some words how can my code be changed to remove the extra spaces when using componentsSeparatedBySring. I'm new to OBjective-C so any help would be greatly appreciated! Here is my code: NSString *myString = @"One Tw...

Actionscript style events in Objective-C?

I'm a newbie doing Objective-C, coming from Flex/Actionscript development. I have an iPhone app with an UIApplicationDelegate conforming delegate called MyAppDelegate - it has a UIWindow. Instead of adding buttons, labels and whatnot directly to the window, I guess I'm supposed to make a child class of UIViewController for every screen...

I m trying to Retrieve the data from XML File into an IPhone application.

The XML File Which i used is : <note> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> <URL>http://192.168.1.75/one.png&lt;/URL&gt; </note> In this XML I have retrieve the text but i failed to display the image from the link in the XML File. I want to display the image in table cell.I have given the coding ...

Xcode view file with one click?

Today I just got a new version of xcode, version 3.2.3 and something changed. Now I can't view files in the editor view to the right of the groups and files pane, unless I right click the file and do view as source code file. If I double click the file it opens a new separate editing window. Really annoying stuff. Is there a preference t...

How to get the text from two UITextFields in Objective-C?

Hi, I have two UITextFields and i am using those to search data when the Return key is clicked. The conditions of searching data i have placed on -(BOOL)textFieldShouldReturn:(UITextField*)textField { if((textField == SearchText1) && (textField == SearchText2)) { ------ } } I need both the text from Se...

initialization makes integer from pointer without a cast

here is the code, where listArray is NSMutableArray ...... listArray = [[NSMutableArray alloc] initWithCapacity:100]; for ( int i = 0 ; i < 100 ; i ++ ) [listArray addObject:[NSNumber numberWithInt:i]]; .... for(int max=99; max >= 0 ; max --) { int rN = (arc4random() % max) + 0; //Warning 1: initializatio...

NSTimer Repeat x times only, then call a selector when it invalidates

Primarily I'm looking for a way to create an nstimer scheduledTimerWithTimeInterval that repeats every 3 seconds 10 times then invalidates just as a no-repeating timer would. Is this possible? Ideally an additional selector would fire once the timer invalidates too ...

Get the a part of content from NSString

Hi, everyone, I want to ask something about the NSString in objective C. I use the following code to retrieve some of the HTML content. NSHTTPURLResponse *response = nil; NSError *error = nil; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *data = [[NSString ...

how to get touch event on flipsideviewcontroller?

I have written this method in my flipsideviewcontroller.m - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event but its not called. WHat shld i do so that when someone touch on flipsideviewcontroller this method called. ...

UIModalPresentationFullScreen clear background color

Hi, I present a modalView using UIModalPresentationFormSheet, when I use self.view.backgroundColor = [[UIColor clearColor]; everything is working fine. My problem is when I use a UIModalPresentationFullScreen, the color don't want to be clear, even an alpha on the view is not working. Soemone have an idea? ...

Should I test public class function, that changes only internal state of the object?

I decided to add unit tests to existing project (quite big one). I am using "google toolbox for mac" for various type of STAssert... and OCMock framework. But I think I'm testing wrong. For example, I have public function saveData, which doesn't return anything and only change internal state of the object. Should I test it? Due to enc...

tutorial to create e-book read application - epub file formate

hi all, I am making an application of e book reading, in that i want to perform some operations like change text color, font, select a text etc. I come to know that iphone os 4.0 and ipad are now supporting epub file formate, but I am not able to know how to create such kind of application. If any one knows how to create such applicati...

How to insert image in xml on iphone

In my app i insert images in the tableview by putting the url of image in the field image of xml!! It's possible insert the entire image directly in XML, including in the field image, instead of the URL, a kind of image compression, for example, the bits that make up the image. ...

Offline map from sdk

In my application i have a MkMapview and now it shows current location. i have to bookmark some other locations and show that locations even if there is no Wi-Fi connection. How to bookmark that locations and how to display the offline maps? how to save map to cache? is it possible? Thanks, ...

Cache UIView on drive?!

Hi, does anyone know if it's possible to cache the entire UIView on a drive not in memory so you don't have to regenerate the entire content everytime you want to access it ... Right now I am preloading three pages on both sides in scroll view but it would be nice to pregenerate the entire edition in background and store it in documents ...

Objective C - Lvalue required as left operand of assignment

Hi, I get the error (Lvalue required as left operand of assignment) for this code: [[addAlertViewController alertsArray] = [NSMutableArray arrayWithObjects:nil] retain]; How can I fix it? ...