How can I create and position a new imageview in objective-c?
Thanks!
I tried this but it doesnt seem to do anything...
-(void)drawStars{ //uses random numbers to display a star on screen
//create random position
int xCoordinate = arc4random() % 10;
int yCoordinate = arc4random() % 10;
UIImageView *starImgView = [[UII...
I'm creating objects which will be sent to a server, and I'm trying to ensure I account for timezone and Daylight Savings issues, so I want my timestamps to be "seconds since 1970" regardless of timezone, etc.
Is [NSDate timeintervalSinceReferenceDate] sufficient for this? In the docs I know it says time since January 1 1970 00:00:00 GM...
What is the best way for a view added via presentModalViewController to communicate its dismissal with the class which invoked the call?
In one of my methods, I use presentModalViewController:animated: to popup a scoreboard where a player enters their name, then clicks OK. Everything is working fine with the scoreboard, but when I use d...
I have a view with buttons. This view sits in a tabbarcontroller. I have just gotten an issue which appears in the device, but not in simulator. If I switch to another tab and back again the view is redrawn and my buttons come out doubled. I know this because the borders are thicker and the buttons with variable text overwrite each other...
I discovered that my drawRect is being called more than once. Unfortunately this had the unfortunate side-effect of double-drawing everything because all my subviews are drawn in drawRect (I'm s strict atheist w.r.t. Interface Builder).
What is the best way to deal with a multiple calls to drawrect? A flag to check if it's being called ...
How can I unselect a UITableViewCell when UITableView has scrolled?
...
I'm sure I have something dumb wrong, but I'm trying to pass the data set in a UIDatePicker from one view to another (I'm using the Utility Template in Xcode).
I've written out all of the pertinent code below.
FlipsideViewController.h
@interface FlipsideViewController : UIViewController {
IBOutlet UIDatePicker *datePicker;
}
@...
I have a UIImageView that is being rounded on my custom drawn UITableViewCell:
rect = CGRectMake(13, 10, 48, 48);
avatar = [[UIImageView alloc] initWithFrame:rect];
[self.contentView addSubview: avatar];
CALayer * l = [avatar layer];
[l setMasksToBounds:YES];
[l setCornerRadius:9.0];
I ...
I would like to achieve a UITableViewCell to look like this image (following/tweets/etc):
...
Does UIWebView pass on referral information? If a user clicks a link to my server and my server immediately redirects the request to a second server. Will the second server see the referral page? What's the default behavior? If that information is pass to the second server, how can I prevent that?
...
How would I display what the Camera can see in a view as if you were using the Image Picker in Camera Mode?
Is this possible, to access the camera directly?
...
So I have a ViewController Class which is my first view, I then add a subview to it, pseudo code code below;
ViewController2 *viewController2 = [[ViewController2 alloc] init];
[self addSubview:viewController2.view];
My question is, in ViewController1, I have a method that does an animation and removes the view. How can I call that me...
I'm creating a new subclass of UITableViewController, and with it the below default
implementation.
It doesn't compile , cause clearly there is no variable called "number of sections",
what's going on here ?
The error is : "expected expression before '<' token"
#pragma mark -
#pragma mark Table view data source
- (NSInteger)numberOfSec...
I'm trying to apply '3D perspective' to a UIView with a UIScrollView embedded inside. This will allow the user to scroll through a set of photos with a 3D effect.
Trouble is, the code below works fine in portrait orientation... but when I rotate the view to the landscape orientation, the scrolling no longer works.
I have tried to nest...
I have a UITableView with a cellForRowAtIndexPath method that creates a UITextView, then adds it to a cell. No memory leaks were detected, but when running Instruments (Object Allocations), the Net memory is on a one-way trip to 18 MB, where it crashes.
My app constantly adds and deletes cells in the tableView datasource, but because t...
How can I make it so the image goes away when it is touched.
Here is my code to create the image. It is randomly displayed on screen so after you touch it, it disappears and a new image in a new place appears.
-(void)drawStarsAndDetectTouches{ //uses random numbers to display a star on screen
//create random position
int xCoord...
I have a view that I am presenting modally. For some reason it animates very slowly.
[self.parentViewController.tabBarController presentModalViewController:browser animated:TRUE];
I'm not sure why? I have even tried:
[self presentModalViewController:browser animated:TRUE];
UPDATE:
The UITableViewController that is presenting it, is d...
Hi,
I want to create a UIImageView object and initialize it with a rectangle image that will be created by programming and NOT from a pre-created bitmap file.
Thanks in advance,
Sagiftw
...
My iPad app uses an external "device" that acts as a hardware keyboard. But, at some point in the settings, I need to input text and I can't use the "device" ("device" is not a keyboard).
So, is there any way to force pop the soft keyboard even thought I have a hardware keyboard connected?
...
Hello,
I've been trying to update an image that is packaged with my app, but the app refuses to load the new file.
I originally had a png called "board.png". I then created a new file which is a higher resolution copy of the original. I deleted "board.png" from the Resources group in XCode and added the new image under the same name. W...