I'm trying to stream a video that is stored on Amazom S3 services.
I've tried passing the url with authentication using MPMoviePlayerController but with no success.
Like this: http://theusername:[email protected]/path/to/the/video
Have anyone done this before? I would like some advices, thanks.
Hi All,
I want to show pop up of question with it's options.
Each question have 3 options.
Currently the text is not fitting in the UIAlertView.
My UIalertView is in landscape mode.
my questions are,
1) How to change the font and font size of UIAlertView message and Button?
2) How to increase the height and width of UIAlertView?
OR please suggest me any other way , by which I implement the same pop up.
Thanks .
I have 3 "pages" (page 0, page 1, page 2) in a UIScrollView that are snapped to by finger swipes. There is a UIPageControl there too. The UIScrollView starts off presenting page 0. What I want to do is present page 3 FIRST sometimes. How can I do this programatically.
Simply setting currentPage (of UIPageControl) to the page number does nothing by the way.
I have a navigation controller in my left portion of my split view, and in the right portion. But sometimes, for example when an item is tapped, my left side must manually set the view controller on the right side.
Where is the best place to store the split view controller instance? Pass it around to each view controller on the left side, like I do with the navigation controller? Store it in my App Delegate and then access it via a property with [[UIApplication sharedApplication] delegate].splitView?
When converting PDF Pages into UIImages I receive memory warnings all the time.
It seems there is either some leak or something else that eats my memory.
Using instruments didn't give me any helpful details.
I'm using the following function to generate images from a pdf file:
- (UIImage*)pdfImage:(NSString*)pdfFilename page:(int)page {
CFURLRef pdfURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)pdfFilename, kCFURLPOSIXPathStyle, false);
CGPDFDocumentRef pdfRef = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
CFRelease(pdfURL);
CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdfRef, page);
CGRect pdfPageSize = CGPDFPageGetBoxRect(pdfPage, kCGPDFBleedBox);
float pdfScale;
if ( pdfPageSize.size.width < pdfPageSize.size.height ) {
pdfScale = PDF_MIN_SIZE / pdfPageSize.size.width;
}
else {
pdfScale = PDF_MIN_SIZE / pdfPageSize.size.height;
}
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL,
pdfPageSize.size.width*pdfScale,
pdfPageSize.size.height*pdfScale,
8,
(int)pdfPageSize.size.width*pdfScale * 4,
colorSpace,
kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
CGColorSpaceRelease(colorSpace);
// CGContextClipToRect(context, pdfPageView.frame);
// CGPDFPageRetain(pdfPage);
CGAffineTransform transform = aspectFit(CGPDFPageGetBoxRect(pdfPage, kCGPDFBleedBox),
CGContextGetClipBoundingBox(context));
CGContextConcatCTM(context, transform);
CGContextDrawPDFPage(context, pdfPage);
// CGPDFPageRelease (pdfPage);
CGImageRef image = CGBitmapContextCreateImage(context);
CGContextRelease(context);
UIImage *finalImage = [UIImage imageWithCGImage:image];
CGImageRelease(image);
CGPDFDocumentRelease(pdfRef);
return finalImage;
}
I am releasing the document and everything else, so where could be the problem?
Thanks for your help!
Hi I am having two date as string , that is assigned to two labels,
one label holds current date string, that is may 29, 2010
similarly the other date will be selected by user in this same format, i need to check the user date is present, past , or future. by comparing with current date string.
please provide some sample code.
Thanks in advance.
I Have an a touchesEnded event that checks for when a UITextField is pressed. What I would like it to do is is hide/show a UIPickerView. How can this be done?
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [[event allTouches] anyObject];
if (CGRectContainsPoint([self.textField frame], [touch locationInView:self.view]))
{
NSString * error = @"Touched the TextField";
UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Selection!" message:error delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorAlert show];
//Want to show or hide UIPickerView
}
}
I already have an allocated UIPickerView when touches occur
@interface ThirdViewController : UIViewController <UITextFieldDelegate,UIPickerViewDelegate> {
IBOutlet UIPickerView *pickerView;
}
My custom subclass extend UIControl (MyCustomUIControl)
Basically it contains 3 subviews:
UIButton (UIButtonTypeCustom)
UIImageView
UILabel
All the class works great but now I want to connect some events generated from this class to another. In particular when the button is pressed I want to forward the event to the owner viewcontroller so that I can handle the event. The problem is that I can't figure out how to implement this behaviour.
Within EditableImageView I can catch the touch event using [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside] but I don't know how to forward it inside of the buttonPressed selector.
I also tried to implement touchesBegan but it seems never called...
I'd like to capture the button press event from the viewcontroller in this way:
- (void)viewDidLoad {
[super viewDidLoad];
self.imageButton = [[EditableImageView alloc] initWithFrame:CGRectMake(50.0f, 50.0f, 80.0f, 80.0f)];
[imageButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:imageButton];
[imageButton setEditing:NO];
}
This is my UIControl subclass initialization method:
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setBackgroundColor:[UIColor clearColor]];
button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0.0f, 0.0f, frame.size.width, frame.size.height);
[button setImage:[UIImage imageNamed:@"nene_70x70.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button];
transparentLabelBackground = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"editLabelBackground.png"]];
transparentLabelBackground.hidden = YES;
[self addSubview:transparentLabelBackground];
// create edit status label
editLabel = [[UILabel alloc] initWithFrame:CGRectZero];
editLabel.hidden = YES;
editLabel.userInteractionEnabled = NO; // without this assignment the button will not be clickable
editLabel.textColor = [UIColor whiteColor];
editLabel.backgroundColor = [UIColor clearColor];
editLabel.textAlignment = UITextAlignmentLeft;
UIFont *labelFont = [UIFont systemFontOfSize:16.0];
editLabel.font = labelFont;
editLabel.text = @"edit";
labelSize = [@"edit" sizeWithFont:labelFont];
[self addSubview:editLabel];
}
return self;
}
Thanks.
Hi,
I've got an UIScrollView and in it different images(about 30). I'd like to make it possible, when user reaches the last image to show the first one after it and so on. And I want to implement the same feature with the first image(to go to the last one).
I'd like to loop the images smoothly that user won't even notice that he is making another loop.
What is the best way to achieve this?
Thanks.
I want to be able to reorder cells in a table, but not to delete or insert them.
I want a picture like this:
This image appears in Apple's Table View Programming Guige, but the code samples there produce a table with red "delete" buttons when the table goes into editing mode.
I can set editingStyleForRowAtIndexPath to UITableViewCellEditingStyleNone and that makes the delete buttons go away, but the rows are still indented as if to make room for these buttons.
I just installed the xcode 4 sdk and the cocos2d 1.0.0 beta template.
I just created a new project with the cocos2d template.
But when I build I got these errors :
(for information my previous projects developed with xcode 3 have the same problem)
warning: couldn't add 'com.apple.XcodeGenerated' tag to '/Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates/xcode4.build': Error Domain=NSPOSIXErrorDomain Code=2 UserInfo=0x201dde680 "The operation couldn’t be completed. No such file or directory"
error: unable to create '/Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates' (Permission denied)
error: unable to create '/Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Products' (Permission denied)
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates/xcode4.build/Debug-iphonesimulator/xcode4.build/Objects-normal/i386
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/PrecompiledHeaders/Prefix-dflnzjtztxdgjwhistrvvjxetfrg
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates/xcode4.build/Debug-iphonesimulator/xcode4.build
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates/xcode4.build/Debug-iphonesimulator/xcode4.build
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates/xcode4.build/Debug-iphonesimulator/xcode4.build
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates/xcode4.build/Debug-iphonesimulator/xcode4.build
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/PrecompiledHeaders/Prefix-fqemzerugrwojibbegzkffljkxqs
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Intermediates/xcode4.build/Debug-iphonesimulator/xcode4.build
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Index/PrecompiledHeaders/Prefix-dbtcglhksokwygezixirqkgfipsr_ast
Unable to create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Index/PrecompiledHeaders/Prefix-gdirtpasdqzasnclnkzguimarjpd_ast
error: couldn't create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Products/Debug-iphonesimulator/xcode4.app: Permission denied
error: couldn't create directory /Users/Benoit/Library/Developer/Xcode/DerivedData/xcode4-bswxazfuwbsguiasyatbtlmvbpps/Build/Products/Debug-iphonesimulator/xcode4.app: Permission denied
The file “Info.plist” doesn’t exist.
Please help !!
Hi.
Not being able to find the answer, and also not being able to do what I want with
CGSize searchBarSize = self.searchDisplayController.searchBar.frame.size;
searchBarSize.width = ;
I ask: is there a way to change the width of a UISearchBar?
Tanks a lot.
I have a bunch of images I am using for cell's image views, they are all no bigger than 50x50. e.g. 40x50, 50x32, 20x37 .....
When I load the table view, the text doesn't line up because the width of the images varies. Also I would like small images to appear in the centre as opposed to on the left.
Here is the code I am trying inside my 'cellForRowAtIndexPath' method
cell.imageView.autoresizingMask = ( UIViewAutoresizingNone );
cell.imageView.autoresizesSubviews = NO;
cell.imageView.contentMode = UIViewContentModeCenter;
cell.imageView.bounds = CGRectMake(0, 0, 50, 50);
cell.imageView.frame = CGRectMake(0, 0, 50, 50);
cell.imageView.image = [UIImage imageWithData: imageData];
As you can see I have tried a few things, but none of them work.
Hi, I'm trying to create a single custom UITableViewCell from a xib, among other normal UITableViewCell's. I've tried quite a few varied things to no success. Can anyone help me please?
In this code I am loading a View Controller (and associated View) from a .xib:
-(id)initWithCoder:(NSCoder *)coder
{
[super initWithCoder:coder];
return self;
}
This successfully works, but I do not really understand what the line [super initWithCoder:coder] is accomplishing. Is that initializing my View Controller after my View has been initialized?
Please be as explicit as possible when explaining. Thanks.
Hello
Currently I have an entity named "Events" in a CoreData app. "Events" has one string property named "eventName".
In the -(void)viewDidLoad I am trying to Fetch all the "Events" objects and load their "eventName" by alphabetical order into a UIPickerView.
The ultimate end goal is through the use of a textField, buttons and the pickerView being add new objects in and remove unwanted objects out. Basically turning the UIPickerView into a UITableView. Currently I am able to save objects to the CoreData store, but am not able to pull them/their properties out into the UIPickerView.
I am willing and able to share the project source code to anyone who wants it, or is willing to look at it to help out.
thanks
Chris
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://feeds.harvest.org/~r/greglaurietv/~5/MW4zfyeubC8/HD100307-iPod.mp4"]];
moviePlayer.scalingMode = MPMovieScalingModeNone;
moviePlayer.controlStyle = MPMovieControlStyleDefault;
[moviePlayer play];
only audio is playing, but nothing shows up in my view.... what am i doing wrong?
It's well known that UIImagePickerController doesn't return the metadata of the photo after selection. However, a couple of apps in the app store (Mobile Fotos, PixelPipe) seem to be able to read the original files and the EXIF data stored within them, enabling the app to extract the geodata from the selected photo.
They seem to do this by reading the original file from the /private/var/mobile/Media/DCIM/100APPLE/ folder and running it through an EXIF library.
However, I can't work out a way of matching a photo returned from the UIImagePickerController to a file on disk. I've explored file sizes, but the original file is a JPEG, whilst the returned image is a raw UIImage, making it impossible to know the file size of the image that was selected.
I'm considering making a table of hashes and matching against the first x pixels of each image. This seems a bit over the top though, and probably quite slow.
Any suggestions?
I have 2 UITableViews on my screen.
As the user scrolls 1... I need the other 1 to also scroll to the same row.
I assume I need to find a "tableViewDidScroll" method... and somehow detect a "whichRowIsDisplayed" value... and then set the other tableView to "displayThisSameRow".
I can't find any of those 3 methods that I need.
Help!
Hey I am using the http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/
wrapper .
My code is this :
- (IBAction)UpdateButtonPressed:(id)sender
{
Sqlite *sqlite = [[Sqlite alloc] init];
NSString *writableDBPath = [[NSBundle mainBundle]pathForResource:@"Money"ofType:@"sqlite"];
if (![sqlite open:writableDBPath])
return;
NSArray *query = [sqlite executeQuery:@"UPDATE UserAccess SET Answer ='Positano';"];
NSDictionary *dict = [query objectAtIndex:2];
NSString *itemValue = [dict objectForKey:@"Answer"];
NSLog(@"%@",itemValue);
}
Answer is the Column name , UserAccess the table name .
the column is at 3rd place in the table
What am I doing wrong why is it crashing ???
I have a application that combines threading and CoreData. I and using one global NSPersistentStoreCoordinator and a main NSManagedObjectContextModel.
I have a process where I have to download 9 files simultaneously, so I created an object to handle the download (each individual download has its own object) and save it to the persistentStoreCoordinator. In the [NSURLConnection connectionDidFinishLoading:] method, I created a new NSManagedObject and attempt to save the data (which will also merge it with the main managedObjectContext).
I think that it is failing due to multiple process trying to save to the persistentStoreCoordinator at the same time as the downloads are finishing around the same time. What is the easiest way to eliminate this error and still download the files independently?
Thank you!
I have a method which needs to run in its own thread 88 times per second (it's a callback for an audio unit.) Should I avoid creating an NSAutoreleasePool each time it's called?
Hello,
I've developed an app for a client and would like to give him an access to my iTunesConnect in order to access to the download stat for his application.
The problem is that if I create a new user and set permission to only see reports, he will be able to get all stats...
And I don't want to get stats manually each day.
Do you have an idea ?
Thanks
From picture i try to update UILabel at cell that i press but it update incorrect row
how can i update text correct row?
mycode when add To accessoryView it will reuse to create each row
self.info = [[UILabel alloc] initWithFrame:CGRectMake((accView.image.size.width/2.5), 0.0, accView.image.size.width/2, accView.image.size.height)];
self.info.text = @"RSS";
self.info.tag = 3;
self.info.textColor = [UIColor whiteColor];
self.info.shadowColor = [UIColor blackColor];
self.info.shadowOffset = CGSizeMake(1,1);
self.info.font = [UIFont boldSystemFontOfSize:11];
self.info.backgroundColor = [UIColor clearColor];
[cell.accessoryView addSubview:self.info];