I want to implement a classX that makes some asynchronous calls but in the eyes of the caller ClassC, classX should seem sequential.
ClassC would instantiate ClassX which makes some HTTP calls through NSURLConnection and thus, it becomes asynchronous (and I want it to stay async).
The logic flows like this:
ClassC:
- (void)callerWo...
I have a lot of people NSManagedObjects that I need filtering and was hoping to do it within the initial fetch instead of filtering the array afterwards. I've used selectors in predicates before, but never when fetching NSManagedObjects, for example I have all my employees and then i use this predicate on the NSArray...
[NSPredicate pre...
Hi all,
I've got a memory leak in Instruments... I've sorted some before, but this one has left me stumped! I would be very grateful if you could help... This is the method with the leak... It takes in a dictionary of data, creates a new based on it and returns it. I've commented the lines with the leaks, and the percentages it gives th...
Dear Developers,
I am getting a potential leak in these methods..can anyone please help me..Leak in method 1 is in line 5..I am referencing this method from another class as [sync loginHandler] where sync is an object of the class which has the method loginHandler..
-(void) loginHandler
{
1 SCRMsugarsoap* service = [[SCRMsugarsoap all...
I have an IntroViewController with a very large image, which increases the memory of my app by about 1.5MB. The image is set on a UIImageView within the View Controller's NIB.
Once the intro has finished, I call release on the IntroViewController, which then successfully calls dealloc on itself and calls release on the large UIImageView...
I have a view that generates an image based on a series of layers. I have images for the background, for the thumbnail, and finally for an overlay. Together, it makes one cohesive display.
It seems to work a dream, except for when it doesn't. For seemingly no reason, I get an EXC_BAD_ACCESS on the specified line below after it's generat...
I am currently using this code to put some text on the screen
userOutput.text=@"";
I want to be able to display an int variable in the string, like you do with printf in C with the %d placeholders. How do I do this with an NSString
...
How to find out the sender's ip address of a udp packet that was received on a device running iOS 3.2 or higher?
For example, if using Python on a computer, I'd use SocketServer.UDPServer which takes a subclass of SocketServer.BaseRequestHandler which defines the handle callback. When a packet arrives, the callback is called and the se...
I have a WebView which works great except in one instance. When it loads a page with a SWF that loads another SWF, the load delegate gets "The operation couldn’t be completed. (NSURLErrorDomain error -999.)"
From what I gather, this error happens when a second request is made before the first has completed (1, 2, 3, 4). I am not express...
Hello,
What would be the best way to return a float Value from a UITextField ?
I`m using :
(dN being the textField)
[dN floatValue];
but it`s returning :
'UITextField' may not respond to '-floatValue' as a warning
...
How can I call an Objective-C method from another class?
For instance in xCode I have two scripts : the delegate and another one. How might I call someFunction on script2 from the delegate?
Thanks!
Christian Stewart
...
I have a simple mp3 playing through AVAudioPlayer and I want to be able to display how much time is left.
I know the answer includes subtracting AVAudioPlayer.duration from AVAudioPlayer.currentTime but I don't know how to implement a function which calculates it while it's playing (like an onEnterFrame in Actionscript I guess). At pre...
Hi,
EDIT: My example might have created some confusion. I have changed the example below to reflect what I want to achieve. Hope this is more clear.
I am trying to define a constant in my objective-c code. I am using the standard #define to do this. Eg:
#define bluh "a"
I would like to define another constant like this
#define...
I've started learning Objective-C a few weeks ago and I still don't understand how to manage the encapsulation of a class correctly. What is the best way to declare a private member variable in a class?
It seems that setting the right getter/setter for your member variable with "@property" is the right way to go, more than just declarin...
I want to create an enum that is global. I've seen examples where they are declared within a method, but i want mine to be accessible by the whole class or even by the whole project (if possible)
What is the syntax for this?
...
I want to make a button that zooms the content of a html page like in the desktop version of safari. I think I might have to use javascript for this? if thats the case, how can I zoom a page with javascript? in UIWebView
...
In Javascript, for example, you can get the arity (the number of arguments a function is supposed to take) by simply func.length. How can I get this information for a method in Objective-C?
...
I allow my user to select phone numbers in my application. How can I then bring up the iPhone call screen and then if possible, initiate the phone call?
...
I am using objective c, and I got some variables like this:
1100
920
845
1439
But I want to change it to :
11:00
09:20
08:45
14:39
The problem is how can I fill the zero when I got three number only? I know the logic can be simple to do it I detect the string length, but is there any way to do it more effectually? Thank you.
...
Hi there, i searched with keyword "wma" but couldn't find similar posts, so i start this post.
My goal is to download wma files from a known website and playback those files. These wma files are recorded radio programs, a sample link looks like: "mms://media.chinabroadcast.cn/eng/music/morning/2010/0825a.wma". Online streaming is accept...