How do I get the contents of the documents directory as a NSMutableArray?
I can get it as a normal NSArray, but as soon as I try to do anything with that array, my app crashes.
Thanks
Hi,
This is a bit of an odd/specific one - possibly a bug?
I'm using MPMoviePlayerViewController to play a variety of files, including Enhanced Podcasts - these are audio files, but with a slideshow of images, often created using GarageBand. Until (i think) iOS 3.2 they weren't supported at all, now they are and play fine in the iPod app, but in my app the slideshow doesn't start, the full screen movie player opens, and the audio begins, but all I see is the QuickTime logo. If I scrub the track the pictures appear - and will continue to play correctly - but I see nothing if I don't scrub!
Any ideas??
On a related note, these files also include a small rectangluar button containing an (i) button on the right hand side - anybody know what it is or should do?! It does nothing for me!
As par my app requirement, there is a couple of scenarios that I need to handle.
Scenario 1: To avoid piracy, I want to include some piece of code, whose job is sending both IMEI and Serial number of IPhone.
Scenario 2: At server side, I've a database, which has a list of both IMEI and Serial No info. Here I wanna validate both IMEI and Serial numbers. If both are not matched then I can make sure that the app is pirated.
Idea seems good. But I don't know how to handle these two scenarios in my app.
Any help is greatly appreciated.
hellow all, in xcode whenever we load a mapview ,it automaticallay shows the current user location right. In my case i am showing another location on map ,such that the map loads the current location and zoomed to the location i have given .. but, the current location point was not showing (the blue one which comes automaticay..).
i have given mapView.showCurrentLocation=TRUE; but its not showing .
so could any one tells the way it works and it should say the current location mark and then zoomed to the point i have given.
Thanks
hello
I've placed this code my didload method, to get a black Navigationbar.
rootTabBarController.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
rootTabBarController.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
its working fine, but when the user rearranges the Icons in the editmode, i'm getting a default blue navigation bar. Can anyone help me to avid this ?
btw: big thanks to the genius crowd!
Hi, I purchased Amazing Slow Downer for iphone. It permits to change audio speed without changing pitch. Could someone please help me in finding the source code for obtaining such a function.
Thank you
Mauro
Hi
I can see that this is something that has been troubling a lot of people:/
I have a UITabBarController that has 4 viewControllers, all of type UINavigationController.
One of the navigationControllers gets a viewController pushed onto its stack, this viewController should be presented in landscape mode/orientation.
The viewController is a graph, it is the absolutely only place in the app where landscape makes sense. (I hide the UITabBar when this is presented to not lead the user to believe this will work everywhere)
To make a UITabBarController respond correctly to changes in orientation all its viewControllers need to return the same value from the delegate method:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
So to accomodate this behavior I have implemented this method in all the viewControllers belonging to the UITabBarController:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BOOL canRotate = [defaults boolForKey:@"can_rotate"];
return canRotate;
}
The "trick" is now that when my can-be-landscape viewController is pushed I do this:
- (void) viewWillAppear:(BOOL)animated {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:YES forKey:@"can_rotate"];
[defaults synchronize];
}
and when it is popped, I do this:
- (void) viewWillDisappear:(BOOL)animated {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:NO forKey:@"can_rotate"];
[defaults synchronize];
}
This works really well. When the viewController is on the stack I can rotate the device and the view follows.
The problem is however, that if the user taps the "back" button on the navigationBar while in landscape mode, thus popping the viewController to the previous viewController, this "old" viewController is of course also in landscape mode. To make things worse, because I set the BOOL to NO, this "old" viewController can not rotate back when I orientate the device to portrait mode.
Is there a way to update everything so that none of my other viewControllers will be in landscape mode when I pop the can-be-in-landscape mode viewController?
I am a bit worried that if this could be done from landscape to portrait it should also be possible from portrait to landscape, thus making my "hack" unnecessary.. but if it can not, then I am back to square one :/
Hope I am close and that someone could help me get there, thanks:)
Hi,
I'm trying to write an application for the iphone where the user will be notified of events such as deadlines. I am looking to override the silent mode and possibly have the notification sound loop until the user activates the application. Any info or documentation would be appreciated.
Thanks.
I've been tasked with creating a magazine style app for iPad. Ideally it would look a little something like the Zinio app: http://www.zinio.com/ipad/ . This app is effectively a shell, allowing you to sample magazines (eg. read the first few pages) and select them for download. The magazines appear to have some sort of overlay, allowing you to interact with some things (eg. tap to watch a video). A few questions that come to mind:
How would I go about delivering content to the user? In-app purchases aren't really an option, as some content will need to be delivered for free. Is it possible to download a package and make this available within the application?
What format would be suitable for displaying the magazine? Sequential images, PDF, ebook?
I'll need to have some form of interactivity. I guess I could have some form of lookup table, which would include information such as if the user taps on this page, within these coordinates, then launch this item.
Anyone dealt with any similar issues?
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *tempImage = [info objectForKey:UIImagePickerControllerOriginalImage];
imgview.image = tempImage;
[self dismissModalViewControllerAnimated:YES];
[picker release];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[self dismissModalViewControllerAnimated:YES];
[picker release];
}
-(IBAction) calllib
{
img1 = [[UIImagePickerController alloc] init];
img1.delegate = self;
img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:img1 animated:YES];
}
all the codes above works well for taking out photos from the photo library.
problem is that when i tried to use it under the UIActionSheet it does not work.
i just copy the lines of codes from the -(IBAction) calllib as follow.
(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
UIImage *detectface = [Utilities detectFace:imgview.image];
UIImage *grayscale = [Utilities grayscaleImage:imgview.image];
UIImage *avatars = [Utilities avatars:imgview.image];
img1 = [[UIImagePickerController alloc] init];
img1.delegate = self;
img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
switch (buttonIndex)
{
case 0:
[self presentModalViewController:img1 animated:YES];
imgview.image = detectface;
break;
case 1:
[self presentModalViewController:img1 animated:YES];
imgview.image = grayscale;
break;
case 2:
[self presentModalViewController:img1 animated:YES];
imgview.image = avatars;
break;
default:
break;
}
}
it does not work. can somebody help me to figure out what is the problem?
the switch case works perfectly without the [self presentModalViewController:img1 animated:YES]; ...
thanks
I know nib files are serialized objects and they have owner, outlets to make connections.
Using XCode Navigation window template I created application, which in its order created 2 nib files - MainWindow and SecondView. I can't understand how MainWindow is referring to SecondView, there is no connection between those two as far as I can see. SecondView's owner is UIViewController and in MainWindow there is a navigation tab which is also UIViewController. But how they are connected in IB I can't understand...
Also I don't understand who is instanciating MainWindow's owner object and where that object is being kept, where is the variable which is UIApplication myApp = [[UIApplication alloc] init].
If I create 10 nib files with UIViewController owner, who will trigger their deserialization?
If some class is nib file's owner, what is the essential responsibilities of that class? Is it deserializing nib file into memory?
Sorry for unorganized questions, I've been reading numerous articles and docs about nib files, but it is still confusing.
Hi,
I am working on an App that is already been made but Memory Management was not considered in the development stages.
So what can I do to keep the App memory usage low as soon as I get a memory warning?
Is there any general tool or some piece of code that I can use to release any unused memory?
My application is working fine on the normal iPad display, but I also need to output to VGA out. When I do this, I need to add the view to the external screen's window which seems to mean that I can't use it to accept input from the iPad screen.
I want to redirect input from the iPad's window to the window displaying on the external screen. As far as I can tell there's no standard method of doing this.
I've tried overriding hitTest on the iPad's window view to send it to the window on the external display, but the coordinates seem to get messed up in the process which makes it nigh unusable.
I've also tried subclassing the iPad's UIWindow and catching events in sendEvent, then trying to send them to the external window, but this doesn't seem to work at all.
Any help would be appreciated, I'm happy to post any code you would like to see.
Thanks,
Jon
How do you compile a resource into the binary in XCode? That way is doesn't show up inside the application bundle as a file and it's not subject to manipulation by a user (whether good-intentioned or bad).
Is this even possible?
I'm particularly interested about this in terms of iPhone apps.
Any help is appreciated!
I am having MKAnnotationView and i have added UIButton to it, by addSubView method with IBAction assigned to it using addTarget method. But when i tabbed on that button IBAction doesn't called ....!
I am not getting, Why it is not working?
How can i add button to MKannotationView so that its IBAction called ???
Plz. help me.
Thanks
hi friends,
I want to move an object over the screen where ever the touch moves, i.e. If I touch and drag my finger then the object should get moved, if any one know about this how to perform, please let me know.
Thank you in advance, vira.
I have a UIView with another UIView inside it. On the inside UIView there is a textbox which I want to fill in. When I try to fill it in the keyboard blocks my view:
The UIViewController has the following
containerView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.view=containerView;
//The apropriate releases etc are further on...
When I touch it, the keyboard comes up as expected, but blocks the textbox I'm trying to fill in. How can I force the view to slide up?
The front view
OptionsFront * fv = [[OptionsFront alloc] initWithFrame:[UIScreen mainScreen].bounds];
[containerView addSubview:frontView];
In the front view is a subview
CGRect bounds = CGRectMake(0.0f, 210.0f, 280.0f, 130.0f);
sv = [[UIView alloc] initWithFrame:bounds];
[self addSubview:sv]; //added to frontView
In sv is a textbox near the botton:
rect = CGRectMake(70.0f, 20.0f, 100.0f, 27.0f);
cf = [self createTextField_Rounded:rect holder:@"+ve"];
[sv addSubview:cf];
So cf happens to be near the bottom of the page. I expected that when I select it, the whole display would move up, but the keyboard just moves up and blocks it.
What can I do?
Appendix:
- (UITextField *)createTextField_Rounded:(CGRect) frame holder:(NSString *) ph
{
UITextField *returnTextField = [[UITextField alloc] initWithFrame:frame];
returnTextField.borderStyle = UITextBorderStyleRoundedRect;
returnTextField.textColor = [UIColor blackColor];
returnTextField.font = [UIFont systemFontOfSize:17.0];
returnTextField.delegate = self;
returnTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
returnTextField.returnKeyType = UIReturnKeyDone;
returnTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
return returnTextField;
}
I'm new to iPhone development and I am writing an iPhone app that needs two different table views, which are selectable using a button bar or tab bar. These table views are both the same size, but only cover about two thirds of the screen from the bottom up. The top portion of the screen remains the same when either of these tables is displayed. I'd also like to animate (flip) these views when the user selects one or the other.
The view that these two tables will be displayed on is the detail view of my app where the user has already selected an item from the primary screen's table. I'm using a UINavigationController to manage the primary and detail views and I have this working. I also have the first of these two detail tables working as part of my detail view, but I think it makes more sense to isolate the code for these two tables and not duplicate all of the code for the part of the detail view that doesn't change.
I don't really care how these two table views are created (either in code or via IB). I've tried several things and I can't seem to figure it out. Any help or ideas (with sample code) would be greatly appreciated!
Hey
is there any way to send whats in a text view (im trying to make a suggestion box) to my email address?
example
user types in the box " I think you should add twitter support"
then that is sent in the background to my email address [email protected]
then a message is popped up on the screen saying "suggestion sent"
just an example of what i mean
Any ideas, tutorial links would be greatly appreciated guys
Thanks
Hello,
I would like to create a search field exactly as the one in Mail application. The field is first hided, and when an user scrolls down, it appears. Could you help me and give some directions where to look for ?
Thank you very much in advance.
I've got the following class that is a wrapper around an ABPerson (ABRecordRef):
@interface Recipient : NSObject {
ABRecordRef person;
}
- (id)initWithPerson:(ABRecordRef)person;
@end
@implementation
- (id)initWithPerson:(ABRecordRef)_person {
if(self = [super init]) person = CFRetain(_person);
return self;
}
- (void)dealloc {
if(person) CFRelease(person);
[super dealloc];
}
@end
I've left some of the methods out, but they aren't relevant to this question.
Everything works fine, except I get an EXC_BAD_ACCESS on the if(person) CFRelease(person); line. Why does this happen? I'm not calling CFRelease or CFRetain at all anywhere else in my app.