objective-c

iPhone: 'Linking' between two sub-view controllers

Here's my view controller hierarchy: | [A] | ---- [A1] | ---- [A2] One accesses view controllers A1 and A2 by tapping A1 and A2 cells respectively within view controller A. Say I have tapped through to A1, and within that view controller I press a button which brings me straight through to A2, how do I: Remove A1 as the visible vie...

Playing videos works on iPhone 4 but not on iPhone 3G

I am using the MPMoviePlayerController to play movies: STVideo *mySTVideo; mySTVideo = [items objectAtIndex:indexPath.row]; moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:mySTVideo.video_url]]; moviePlayerViewController.view.backgroundColor = [[UIColor alloc] initWi...

how to add a custom subview inside TTThumbviewController (Three20)

Hi, i am developing an iphone application which have to show images from server as thumbnail list. I have created thumbnailview using Three20 package TTThumbViewcontroller class. Now i have to add banner view above the thumbnail view as shows in the image. Also i have to add the bottom banner view in the TTPhotoviewcontroller also. c...

How to make a pseudo-alertview with a nib?

I want to put on the screen a pseudo-UIAlertView which is just a UIView plus buttons in a nib I've created with IB.... what's the best way of doing this? ...

Put a nsmutablestring into a other nsmutablestring

if I have a nsmutablestring, I can set his string with the method setString. But this method only takes NSString, How I can put a nsmutablestring into my nsmutableString. If I do this: mutableStringA = mutableStringB, this will change the pointer of mutableStringA and not his string value, is it true? Alex ...

Place information in Mac Menu Bar Item

I hope this isn't too general. I'm a beginner and I'm trying to learn how to make a Status Bar (menu on the right side) for Mac in Objective-C. I've managed to create the basic outline, but I don't know what the method to use for a particular action: I would like when the drop-down menu appears for it to call a method that will return t...

Method in objective-c never called.

I've got this class. .h: #import @class GLEngine; @interface opengl_engineAppDelegate : NSObject { // Pointer to engine GLEngine * myGLEngine; UIWindow * window; } @property (nonatomic, retain) IBOutlet GLEngine * myGLEngine; @property (nonatomic, retain) IBOutlet UIWindow * window; @end Here is .m: #import "ope...

Getting CPU info from Process ID

If anyone could please help me out, that would be great :) This seems to be a tough one. Starting from the process ID, I need to be able to grab: How much CPU the process is taking up in % How long the process has been using the CPU This needs to be written in Cocoa/ Objective-C or C. It also needs to work on Tiger through Snow Leop...

nsmutabledictionnary with nsmutablestring forkey

I have a nsmutabledictionnary, and when I use setObject:forKey: with a nsstring key it works when I try objectForKey, but if I put a nsmutablestring in the key argument of the SetObject:forKey: method, it's not work when I call objectForKey, it return the last object in the dictionnary... sorry for my english I do my best... Alex ...

I can't see the output of NSTask - objective-c JAVA

Here is my code: NSTask *setupTask = [NSTask new]; [setupTask setLaunchPath:@"/bin/sh"]; [setupTask setArguments:[NSArray arrayWithObject:@"/applications/jarvis/brain/server.sh"]]; [setupTask setCurrentDirectoryPath:@"/"]; NSPipe *outputPipeSetup = [NSPipe pipe]; [setupTask setStandardInput:[NSPipe pipe]]; [setupTask setStandardOutput:o...

TableView help pushing a custom view

Hello again, So I am trying to simple traverse to the next level of a table view by doing this: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 1) { FiltersController *aFiltersCont = [[FiltersController alloc] init]; aFiltersCont.displayedFilters = [appD...

How do I set the right margin of a UITextView?

I have a vertically-scrolling UITextView that fills the width of the screen. I need the text view to have margins (contentInset) of 20 pixels on the left and the right. But for some reason, I can't get the right-hand margin to work, either in Interface Builder or in XCode. The reason I can't just make the text view narrower is because I...

Declare Dynamic Array

How Can i declare dynamic array ? for example int k=5; i want to have an array like below int myArray[k] ...

IPhone App Settings: Settings.bundle vs plist file?

Hi, I'm a bit confused. I'd like to implement some simple settings for my app. I was thinking of just creating a simple plist file. But now I see that there's something called "Settings.bundle" (that also has a plist in there but some other stuff too). What I'm wondering, which one should I use? (I'm looking for the easiest way) Than...

Should the View in MVC have its own class?

I'm a bit confused about the MVC paradigm in relation to iPhone development. Currently, I'm splitting the app into: Model (FooModel.h, FooModel.m) View (FooView.xib) Controller (FooController.h, FooController.m) But should I instead use for the View a subclass of UIView (FooView.h, FooView.m)..? It's just a simple game app. ...

Is the app delegate class needed? (design suggestion)

Hi all I am not clear about the need to create an app delegate class, instead of adding the delegate methods in the viewcontroller directly. Is there any reason why someone want to have a separate delegate class? Style preference? Design constrains? (I am following the MVC model, as Xcode users and app makers do). I am asking since i ...

iphone, how to refresh the gui?

Hi guys, i'm coding a small app for the iphone (just for fun) what i want: if i press the "update" button: send something to the server parse the answer of the server update the content of some labels on the screen show the answer play a system sound //using the audio toolbox sleep some secods, just enough to finish the previos s...

Scaling UILabel text with the parent view

I have a UILabel that is a subview of a larger UIView. Is there a way to keep the text inside the UILabel proportional to the parent UIView so that when the parent changes size, either smaller or larger, the font size for the text in the UILabel will grow and shrink proportionally? ...

Apple private API rejection with libarchive

I'm using libarchive and I have included the source and headers in my iphone project. Apple rejected the binary saying I've wrongfully used private APIs for a bunch of functions. One such functions is: archive_read_data How am I wrong? I want to keep my code because it works well but I also want a speedy acceptance. How do I solve t...

Example of using UDP in obj-c/C++?

Hey, I'm making an iOS app - real-time game, wanna use UDP protocol. I'm searching a lot for examples/guides, but can't find any. Also, the software on the server will use C++, and I've searched a lot and can't fina a nice way to use it, for begginers in C++... I found that: http://developer.apple.com/mac/library/samplecode/PictureShar...