The compiler complains about this:
int randomSort(id obj1, id obj2, void *context) { // first line
return (arc4random()%3 - 1);
}
in first line:
_cmd undeclared
and
'self' undeclared (first use in this
function)
When I not use arc4random() here, i.e. just return 1, everything is fine. I have other c functions in th...
Hello,
I am trying to create a scripting addition but it does not work: When I send teh apple event to an application, I have the message: no handler for this event.
I've tried to install my osax in /library/scriptingadditions but it still does not work.
Any idea on where can be the issue?
Thanks in advance :)
...
I need to obtain a Social Security Number in my app, but I don't want the number itself to display in the interface. How do I go about obtaining the input without disclosing the confidential information on the screen?
I have to fill up this application which asking for my social security system number but instead of writing down the nu...
Can someone post the simplest example on how to use controlTextDidChange with a text label in the .h and .m files? Another part of my code constantly changes the value of this text label multiple times a second. I just need another part of my script that can tell if the value has changed and preform an action. All these websites out ther...
Is it possible to do something like this?
if (myVariable == 100 for more than 1 second) {
}
So if myVariable equals 100 for more than 1 second do something.
Thanks!
Elijah
...
Is there a way to make a custom keyboard to pop up when a user presses on a UITextField. I have a view with a custom keypad on it and I want that to come up when the user presses on the UITextField instead of the default apple keyboard.
...
Hello everyone,
I wanted to ask if there is any way to control the volume of the system sound effect. When I press the volume control toggle (up and down) in the game, the system sound effects does not get affected. I also read that this should be affected by the ringer volume. But the weird thing is that when I press the volume up and ...
In iTunes, you will see that the first two columns (the first narrow one containing nothing) and the second one containing song name, are not movable. The others are movable.
How can I accomplish this with an NSTableView?
...
Hi,
I am going through the source code for the above project and I don't understand the following lines of code can anyone help explain it to me please? I am trying to get the code to work with color images as it currently only works with greyscale images. I have the main methods working however the filters only get applied to the top qu...
I have an intermittent bug that is confounding me. Any advice on how to track it down or what might be the cause are greatly appreciated.
I have a "DetailView" with a few labels, an Image View and a Text View. In the navbar I also have a camera button to open an Image Picker and take a picture (later added to the image view). Basic stuf...
This has been driving me nuts all day.
I have a weird bug that I think I have narrowed down to an NSPredicate. I have two entities: List and Person. List has a to-many relationship to Person called persons and Person has a to-many relationship to List called lists.
I pass to my a tableview controller a List object. I then want that tab...
Hi,
I was reading the Memory Management Guide for IPhone OS and I didn' t understand a point in the Autorelease Pools section Listing - 1 code example :
void main()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *args = [[NSProcessInfo processInfo] arguments];
for (NSString *fileName in args) {
NSAutoreleas...
Simply, is it possible to change a "static text" field in an Apple system dialog box? Specifically I am looking into changing some label text of a password popup. I have tried using AppleScript via GUI scripting:
tell application "System Events"
try
tell window 1 of process "loginwindow"
repeat until not (value o...
My friend has recommended me this site and said you were very helpful. Nobody seems to know this information.
...
I need to have a loop that can constantly check for this variable:
NSString *charlieSoundVolume;
charlieSoundVolume = [charlieSoundLevel stringValue];
This variable will change by an interface builder patch. I was thinking of doing this:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
while(1) {
float fl...
I am building an iphone game. I have a set of NSStrings that I set periodically throughout the game life cycle. I am finding that I am in need of setting the same NSStrings often and looping through an array of NSStrings is ok for checking the value of the NSStrings atIndex:i, but setting them using the same method results in nothing. Ba...
Ok, so I have an NSTextField and an NSSlider. In interface builder, I got the float value from the NSSlider to go into the NSTextField. BUT, I need a button that sends the text from the text field in so I can get the value in my code. That text field can also accept manual input so I cannot just link the NSSlider to my code. This is simi...
Hello,
I want to ask about the NSArray in objective C.
I want to create a dynamic array as I don't know about the size of the array. And I also want to insert some of the data to the array. However, I don't know how to decl, init and insert the element in to the array.
The following is the C++ version.
I want to create a empty array A...
Here is the code:
- (IBAction) startRecognition:(id)sender {
backgroundSoundLevel = [backgroundSoundChange stringValue];
timer = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(timerFired:) userInfo:nil repeats:YES];
}
- (void)timerFired:(NSTimer*)theTimer
{
NSString *charlieSoundVolume = [cha...
So I read about Interface Builder Plug-Ins but from what I understood they're not supported on IPhone on the MAC.
Basically I want to create a User Control (this is a .NET term) is this possible in iPhone development? A user control is basically like me trying to create my own custom button, or own custom slider, etc so that it is easil...