In my iPhone application, I have the following line in a constructor:
self.myVar = myVar_in;
where myVar is a property and myVar_in is a parameter passed to the constructor.
When I run the code, I get an EXC_BAD_ACCESS error on this line. However, when I replace the line with:
[myVar release];
[myVar_in retain];
myVar = myVar_in;
t...
This is with reference to the StackOverflow question Managing multiple asynchronous NSURLConnection connections
I have multiple asynchronous HTTP requests being made at the same time. All these use the same NSURLConnection delegate functions. (The receivedData object is different for each connection as specified in the other question ab...
I`m newbie in objective-c and I have some questions:
What is an IMP?
What is msgSend function?
...
Is there any way to detect when an NSView will be dealloc'ed?
The reason is, I have some simple delegates (such as an NSTextField delegate that handles -control:textView:doCommandBySelector: to allow the return/tab keys to be entered). I'd like to just stick this delegate object in the nib, wire up the NSTextField's delegate connection...
I've noticed that several iPhone apps, especially some more graphically intensive games take quite a while to exit when the home button is pressed.
My question is, weather it's possible to artificially recreate this situation, the reason being, that I'm trying to implement a sort of "phone protector" that starts making loud noises when ...
Hey,
I'm learning Cocoa and while I get comfortable with Objective-C and the concepts around it, I sometimes struggle applying the theory (like MVC) in praxis. Apple's documentation often gives me aha moments, but it would be cool to have a well written Cocoa App as a reference.
So, do you know a very well written Cocoa App with public...
I wish to start at let's say row 2 with my content. I've tried putting in an integer for indexPath but that doesn't work.
So in the following example circumference would start at the second row ( and the rest would follow).
http://lh3.ggpht.com/_ixq8Dp4ESMo/SYuylQNqNCI/AAAAAAAAAFk/pPW6pbIlPGo/s576/Screen1.jpg
...
here is sample code.
if(MyPageViewControllerObj==nil)
{
MyPageViewController *vController = [[MyPageViewController alloc] initWithNibName:@"MyPageView" bundle:[NSBundle mainBundle]];
self.MyPageViewControllerObj=vController;
[vController release];
noOfWrongAnswers=0;
noOfRightAnswers=0;
}
MyPageViewControllerObj.sessionid=s...
how can I allocate custom memory?
...
i have page control sample from apple and using it in my application... in my application scrolling is running smooth in simulator but when installed on device it is not smooth.
does someone knows about it? i am also doing some flip animation.it's also not running smoothly
...
Are there situations where a UIAlertView is better to use than a UIActionSheet? What are the typical scenarios where you would use one over the other?
I'm programming a navigation bar button to open a UIWebView in an external application, and at first I started programming a UIAlertView, then I thought that an action sheet might be bett...
I've a small problem and I can't find a solution!
My code is (this is only a sample code, but my original code do something like this):
float x = [@"2.45" floatValue];
for(int i=0; i<100; i++)
x += 0.22;
NSLog(@"%f", x);
the output is 52.450001 and not 52.450000 !
I don't know because this happens!
Thanks for any help!
~SO...
In my application, I would like a modal view to present itself when the app starts up and there is no wifi. I have code like this in the applicationDidFinishLaunching:
UIViewController *modalViewController = [[UIViewController alloc] initWithNibName:@"ModalDisconnect" bundle:nil];
[[self tabBarController] presentModalViewController:m...
I have a MKMapView that has a number of annotations. Selecting the pin displays the callout and pressing the accessory pops a new viewcontroller onto the stack. However when I press back from that new VC the callout is still open. How do I close it?
I have tried
if([[myMapView selectedAnnotations] count] > 0)
{
//deselect that anno...
Hi Everyone,
I am not sure if StackOverflow is the right service to ask this question but I believe it worths to try.
I am an experienced PHP developer and now interested in building some iPhone apps. I have searched on Google for tutorials about objective-c but couldn't find a good one for beginners.
Do you have any suggestion, somet...
I am creating an array of dictionaries in a class. I want to return a copy of that array to any other object that asks for it. This copy that is passed to other objects needs to be modified without modifying the original.
So I am using the following in a getter method of my class that holds the "master" array:
[[NSMutableArray alloc] i...
I have:
@interface A
@property (nonatomic, retain) B *toB;
@end
@interface B
@property (nonatomic, retain) A *toA;
@end
This causes the compiler to give me this:
error: expected specifier-qualifier-list before 'Property'
Now, it appears this has something to do with the order of parsing the files as independently, they work as long...
In my previous question I was asking for a next button and it had to act as if the cell was selected. Some decent answers were given and I was satisfied for the moment. However, I noticed that the actions behind my cells depend on a touch.
Now, I read some stuff on the UITouch and I was wondering is it possible to simulate a touch here...
I started to develop my singleton class but I have a problem.
What I want to do is have a search objects containing the values of the search form that I could use in several views.
I want to have the ability to get the singleton in any view in order to perform the search or build the search form.
So I have a set of values with a boolean ...
OK, this is driving me nuts -- please tell me I'm not losing my mind!
I declare:
NSMutableDictionary* generalSettingsDict;
im my .h
I init:
generalSettingsDict = [[NSMutableDictionary alloc] initWithCapacity:5];
in a viewWillAppear
I set:
[generalSettingsDict setValue:[NSNumber numberWithBool:control.on]
...