I Just purchased my app from the app store. It is unbelievable slow! I then ran my same code via the USB cable and it was blazing fast. what is wrong?
If I create an adhoc app will that allow me to see where things are going wrong?
I am new to iOS development. I am trying to connect to a storyboard from xib file. My xib View Controller has a "Login" which if successful should connect to storyboard. I have googled and searched on stackoverflow for a solution and I am using this code that is given everywhere:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
YourViewController * yourView = (YourViewController *)[storyboard instantiateViewControllerWithIdentifier:@"identifier ID"];
I have created an identifier for my storyboard as well. However, I am not being redirected to the storyboard no matter what I try. When the login finishes, I go back to my main View Controller (xib). I should be instead redirected to the storyboard. Here is what my code looks like in a file called ProfileTabView.m:
-(void) loginViewDidFinish:(NSNotification*)notification
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
ProfileTabView * yourView = (ProfileTabView *)[storyboard instantiateViewControllerWithIdentifier:@"myID"];
}
I have implemeted this code in the function that gets called once the login is successful. However, the storyboard "Storyboard" never gets called. Am i doing this right? Am I supposed to be writing this code anywhere else?
Thanks a lot for any help :)
sir
I'm getting 2 different values
in back button click
My question is,
*If I want to back to view as per my value coming in int variable.
how is it possible?
*My second question is that my project is based on UINavigationController
So,how should i do that?
bcoz i'm using PushviewController to puch the new view from olderview
Thanks in advance
I'm fetching data from iCloud and for that I need to generate a header (azure table storage).
I used the code below for that and it is generating the headers. But when I use these headers in my project it is showing "make sure that the value of authorization header is formed correctly including the signature."
I googled a lot and tried many codes but in vain.
Can anyone kindly please help me with where I'm going wrong in this code.
-(id)generat{
NSString *messageToSign = [NSString stringWithFormat:@"%@/%@/%@", dateString,AZURE_ACCOUNT_NAME, tableName];
NSString *key = @"asasasasasasasasasasasasasasasasasasasasas==";
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
const char *cData = [messageToSign cStringUsingEncoding:NSUTF8StringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);
NSData *HMAC = [[NSData alloc] initWithBytes:cHMAC length:sizeof(cHMAC)];
NSString *hash = [Base64 encode:HMAC];
NSLog(@"Encoded hash: %@", hash);
NSURL *url=[NSURL URLWithString: @"http://my url"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request addValue:[NSString stringWithFormat:@"SharedKeyLite %@:%@",AZURE_ACCOUNT_NAME, hash] forHTTPHeaderField:@"Authorization"];
[request addValue:dateString forHTTPHeaderField:@"x-ms-date"];
[request addValue:@"application/atom+xml, application/xml"forHTTPHeaderField:@"Accept"];
[request addValue:@"UTF-8" forHTTPHeaderField:@"Accept-Charset"];
NSLog(@"Headers: %@", [request allHTTPHeaderFields]);
NSLog(@"URL: %@", [[request URL] absoluteString]);
return request;
}
-(NSString*)rfc1123String:(NSDate *)date
{
static NSDateFormatter *df = nil;
if(df == nil)
{
df = [[NSDateFormatter alloc] init];
df.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
df.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
df.dateFormat = @"EEE',' dd MMM yyyy HH':'mm':'ss 'GMT'";
}
return [df stringFromDate:date];
}
I wonder in which cases it would be good to make an NSManagedObjectModel completely programmatically, with NSEntityDescription instances and all this stuff.
I'm that kind of person who prefers to code programmatically, rejecting Interface Builder. But when it comes to Core Data, I have a hard time figuring out why I should kill my time NOT using the nice Xcode Data Modeler tool.
And since data models are stuck to a given state (except when you want to do some ugly migration operations where thinks probably go wrong and users get mad, really mad), I see no big sense in a data model that's made programmatically for the purpose of changing it all the time.
Did I miss something?
Fo styled text (bold, italic, diff fonts and sizes), what's the best solution for putting a chunk of text within a cell? The text can of various lengths, so the cell would have to change it's height accordingly.
I have a set of 100 rows, pretty similar to values which can be selected in a picker. When the user scrolls the table, I want the rows to be appended like an forever-ongoing assembly-belt. So when the user scrolls down and reaches the row 100, and scrolls even further, the table view will show again row 1, and so on. Reverse direction same thing.
My thoughts:
don't display scroll indicators (they would make not much sense, probably)
what value to return in the numberOfRows delegate method? This infinity constant?
in cellForRowAtIndexPath: simply wrap the index around when it exceeds bounds?
Hi,
I have a UIView which I can zoom to (as it is set as a subview of UIScrollView). UIView has UILabel, UITextField, etc.
If I just zoom to the UIView, then of course label and text field get fuzzy (the same effect if you are zooming to the image file without changing image resolution).
To solve the problem I need to increase the font size and sizes of the UILable and UITextField in according to the scale used to zoom in (scale is passed as a param by the UIScrollView).
This is where I am getting confused.
Changing frame (by increasing it width and height by zooming scale) I get all my elements (sub-views) repositions (because changing frame effects center and bounds)
Question:
1. What would I need to do to zoom in to the sub-views and just increase the sub-view sizes while keeping them in the exactly the same position?
thanks
I have a UITableView with 3 sections inside of a UIViewController. Is it possible to have other controls above the UITableView for example a UISlider or a UIImage? If so, how can this be accomplished?
Note: These controls should not be in a UITableViewCell, they should be part of the view.
It is not often that we are compelled to direct you toward a product launch event. But this one is special.
On Dec. 1, Oracle will launch (via live Webcast) Oracle WebLogic Server 12c, a major update to that product. And this release, which includes Java EE 6 support, Active GridLink for Oracle RAC, and Oracle Virtual Assembly Builder, among other things, is specifically designed to improve the process of deploying apps to the cloud.
Even better: the Dec. 1 Webcast includes an hour-long, developer-focused deep-dive session in which product experts will answer your questions via live chat. (Register for this session separately.)
You don't want to miss this one, folks!
Hey guys, I am grabbing a JSON array and storing it in a NSArray, however it includes JSON encoded UTF-8 strings, for example pass\u00e9 represents passé. I need a way of converting all of these different types of strings into the actual character. I have an entire NSArray to convert. Or I can convert it when it is being displayed, which ever is easiest.
I found this chart http://tntluoma.com/sidebars/codes/
is there a convenience method for this or a library I can download?
thanks,
BTW, there is no way I can find to change the server so I can only fix it on my end...
I have a 'Contact' class with two properties : firstName and lastName.
When I want to display a contact's full name, here is what I do:
NSString *fullName = [NSString stringWithFormat:@"%@ %@", contact.firstName, contact.lastName];
But when the firstName and/or lastName is set to nil, I get a "(null)" in the fullName string. To prevent it, here's what I do:
NSString *first = contact.firstName;
if(first == nil) first = @"";
NSString *last = contact.lastName;
if(last == nil) last = @"";
NSString *fullName = [NSString stringWithFormat:@"%@ %@", first, last];
Does someone know a better/more concise way to do this?
So I dynamically create 3 UIButtons (for now), with this loop:
NSMutableArray *sites = [[NSMutableArray alloc] init];
NSString *one = @"Constution Center";
NSString *two = @"Franklin Court";
NSString *three = @"Presidents House";
[sites addObject: one];
[one release];
[sites addObject: two];
[two release];
[sites addObject: three];
[three release];
NSString *element;
int j = 0;
for (element in sites)
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//setframe (where on screen)
//separation is 15px past the width (45-30)
button.frame = CGRectMake(a, b + (j*45), c, d);
[button setTitle:element forState:UIControlStateNormal];
button.backgroundColor = [SiteOneController myColor1];
[button addTarget:self action:@selector(showCCView:)
forControlEvents:UIControlEventTouchUpInside];
[button setTag:j];
[self.view addSubview: button];
j++;
}
The @Selector method is here:
- (void) showCCView:(id) sender {
UIButton *button = (UIButton *)sender;
int whichButton = button.tag;
NSString* myNewString = [NSString stringWithFormat:@"%d", whichButton];
self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
self.view.backgroundColor = [UIColor whiteColor];
UINavigationBar *cc = [SiteOneController myNavBar1:@"Constitution Center Content"];
UINavigationBar *fc = [SiteOneController myNavBar1:@"Franklin Court Content"];
UINavigationBar *ph = [SiteOneController myNavBar1:@"Presidents House Content"];
if (whichButton = 0)
{
NSLog(myNewString);
[self.view addSubview:cc];
}
else if (whichButton = 1)
{
NSLog(myNewString);
[self.view addSubview:fc];
}
else if (whichButton = 2)
{
NSLog(myNewString);
[self.view addSubview:ph];
}
}
Now, it is printing the correct button tag to NSLog, as shown in the method, however EVERY SINGLE BUTTON is displaying a navigation bar with "Franklin Court" as the title, EVERY SINGLE ONE, even though when I click button 0, it says "Button 0 clicked" in the console, but still performs the else if (whichButton = 1) code.
Am I missing something here?
Hello! I would like to set up a proxy object in the application NIB file. The problem is that the NIB file is the main application NIB that gets loaded automatically by the application and therefore I cannot set up the UINibProxiedObjectsKey dictionary as described in the documentation. Is there a way to set up a proxy object in the main application NIB? Or can I tap into the code that loads the main application NIB?
Hi,
How can I detect a self signed certificate from a revoked or expired ones?
I'm using NSURLConnection and implementing connection:didReceiveAuthenticationChallenge: on delegate:
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]){
NSURLProtectionSpace *tmpSpace=[challenge protectionSpace];
SecTrustRef currentServerTrust=[tmpSpace serverTrust];
SecTrustResultType trustResult;
OSStatus err = SecTrustEvaluate(currentServerTrust, &trustResult);
BOOL trusted = (err == noErr) && ((trustResult == kSecTrustResultProceed) || (trustResult == kSecTrustResultUnspecified));
if (trusted){
// Do something
}
}
}
Currently the "if (trusted){}" block only work for certificates trusted by iOS, I want it to work for others as well, but only if the certificate isn't revoked or expired.
The documentation is using SecTrustSettingsSetTrustSettings for changing the settings and reevaluate the trust. but I couldn't find this method (or the SecTrustSetting) for iOS, only for Mac.
Thanks
Hi i am developing an app for my QA department. I need to programically get how many phone numbers are there in the entire address book. No user input. Just click a button and then get how many phonenumbers are there in the ENTIRE addressbook.
Please email me at [email protected]
I'm new to memory-management, and am reading different things about how to best release properties.
If I have:
in .h:
@property(retain) NSString *myStr;
and in .m:
@synthesize myStr = _iVarStr;
Should my dealloc have:
[_iVarStr release];
or
self.myStr = nil;
or something else?
Thanks!
Hello,
How to get file size of pdf,gif,doc etc using xcode.
suppose to i get pdf file form resorce folder so how can i get size of for this file.
is there any way?
Thanks you,
I am working with an app similar to apple's core data recipes sample code. I want to be able to delete the entry from the detail view, much like apple's contacts app.
The code below is deleting the 1st entry and not the selected entry. Not sure what I am doing wrong.
NSIndexPath *indexPath = [myTableView indexPathForSelectedRow];
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext];
[context deleteObject:[fetchedResultsController objectAtIndexPath:indexPath]];
[myTableView reloadData];
+-----------------------+ +--------------------+
| A | | A |
| +-------------------+ | | +----------------+ |
| |B | | | | C | |
| | | | | | | |
| +-------------------+ | | +----------------+ |
+-----------------------+ +--------------------+
I have a view hierarchy as above.
(Each of B and C takes up whole space of A, Each of them are screen size. B is added first and C is added next)
For a reason, C is getting a touch event for scroll effect
(B is cocos2d-x layer and C(scroll view) sets the B's position when scrollViewDidScroll
http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/
)
And I want to pass touch event to B or it's subviews when it's not scrolling.
How can I pass the touch event to B here?
I've been doing some head banging on this one and solicit your advice.
I am building an app that as part of it's features is to present PDF forms; meaning display them, allow fields to be changed and save the modified PDF file back out. UIWebViews do not support PDF interactive forms.
Using the CGPDF apis (and benefit from other questions posted here and elsewhere), I can certainly present the PDF (without the form fields/widgets), scan and find the fields in the document, figure out where on the screen to draw something and make them interactive.
What I can't seem to figure out is how to change the CGPDFDictionary objects and write them back out to a file. One could use the CGPDF Apis to create a new PDF document from whole cloth, but how do you use it to modify an existing file?
Should I be looking elsewhere such as 3rd party PDF libs like PoDoFo or libHaru?
I'd love to hear from anyone who has successfully modified a PDF and written it back out as to your approach. Thanks!