GithubHelp home page GithubHelp logo

iphone-3.0-cookbook-'s People

Contributors

erica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iphone-3.0-cookbook-'s Issues

02 - HelloWorld2 to work after Refactor > Convert to Objective-C ARC...

I am trying to create the new project from scratch referring to 02-HelloWorld2 sample.

Because '@autoreleasepool' is used instead of 'NSAutoreleasePool' lately,
I tried to convert the sample to see how it works.
Actually, the build was finished with 'No issues' but the screen looks black screen.
Then I checked the debug output to find the following message.

"Applications are expected to have a root view controller at the end of application launch"

What should it be arranged to work like before refactor?

Cheers.

a small issue of ModalHUD.m

While calling [ModalHUD dismiss]; immediately after [ModalHUD showHUD:@"***"]; invoked ,
The alertView will not dismiss as expected.

-(void) dismiss {
UIAlertView av = (UIAlertView )[[[UIApplication sharedApplication] keyWindow] viewWithTag:MODAL_HUD_UNIQUE_ID];
// Wait for av to finish displaying
if(!av) {
// NSLog(@"wanted for find alertView");
[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(dismiss) userInfo:nil repeats:NO];
}
[av dismissWithClickedButtonIndex:0 animated:YES];
}

Chapter 19 Queried Color List crashes on scroll after search is canceled (possible fix?)

When you run the app, search works perfectly. However, if you scroll your results (or click Search to resignFirstResponder), then touch the Cancel button without clearing the searchBar text, the TableView doesn’t update correctly and the app crashes on scroll, e.g.,

'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (2) beyond bounds (2)'

This bug only occurs if you scroll (or otherwise resignFirstResponder) after the search without manually clearing the searchBar text before hitting Cancel. I couldn’t figure out what caused this, but I found a solution (I think).

  • (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
    [self.searchBar setText:@”"];
    [self performFetch];
    }

Now the app seems to deal with the Cancel button correctly.

AppDelegate Interface is Empty

I noticed in a lot of your recipes, @interface HellowWorldAppDelegate is empty. I know you say you do that to keep the code in one file, to make it easier to present for learning purposes, etc. But the problem is, I don't know what the good practices are for the @interface AppDelegate and declaring variables in header files, when to do so, etc...

When selecting the iphone view template, it declares the window and viewController in the AppDelegate interface. It also does:

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet AppNameViewController *viewController;

and in the implementation file it does @synthesize and defines a dealloc method. Even though you say dealloc is never called, what if iPhone one-day decides to start calling it? For convenience, it makes sense to leave it out, but in practice, is it good practice to leave it in?

If we should declare things in the appDelegate, what should be declared? Just the window and viewControllers? which viewControllers? I see some applications on github that define other variables too. But then, sometimes they just define the variables in the implementation w/o declaring them in the header file? When should we do which?

Maybe you could provide one sophisticated, complete project in the beginning with different files, etc. that shows the best practices for organizing an application and defining variables, etc.

Thanks!

Matt

+doUnrotateImage: not working

I modified your example and found that simply drawing a UIImage into a graphics context and then creating a fresh UIImage removes the orientation by default. The following code does a scale with aspect ratio preservation and orientation correction.

  • (UIImage *) scaleImage: (UIImage *)image scaleFactor:(float)scaleBy
    {
    CGSize size = CGSizeMake(image.size.width * scaleBy, image.size.height * scaleBy);

    UIGraphicsBeginImageContext(size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGAffineTransform transform = CGAffineTransformIdentity;

    transform = CGAffineTransformScale(transform, scaleBy, scaleBy);
    CGContextConcatCTM(context, transform);

    // Draw the image into the transformed context and return the image
    [image drawAtPoint:CGPointMake(0.0f, 0.0f)];
    UIImage *newimg = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return newimg;
    }

If you see a flaw with this approach, let me know.

Thanks for all the great recipes!
Jason

Tracking Upload progress Callback (FTPHelper)

Hi i see that there is a callback to tracking the download progres but no for the upload. There is a way to put the callback to track the progress of the upload when there are still byte available to send?

Thank you in advance.

CGRectMoveToCenter

I bought your book: IOS cookbook and I have a short question, if u have time to answer:
The method below that is included in "UIView-ViewFrameGeometry.h" has an error.

// if i make a Rect
CGRect myRect = CGRectMake(10, 10, 10, 10);

NSLog(@"%@",NSStringFromCGRect(myRect));

// and try to move to Center (100,100)

myRect = CGRectMoveToCenter(myRect, CGPointMake(100, 100));

NSLog(@"%@",NSStringFromCGRect(myRect));

2013-03-15 11:56:05.014 HelloWorld[789:11303] {{10, 10}, {10, 10}}

2013-03-15 11:56:09.240 HelloWorld[789:11303] {{85, 85}, {10, 10}}

CGRect CGRectMoveToCenter(CGRect rect, CGPoint center)
{
CGRect newrect = CGRectZero;
newrect.origin.x = center.x-CGRectGetMidX(rect);
newrect.origin.y = center.y-CGRectGetMidY(rect);
newrect.size = rect.size;
return newrect;
}

So, i guess its a mistake or maybe I didnt understand the purpose of this method! I thought that this method should move a rect to another coordonates and his new center will be the CGpoint I wanted.
So the method should look like this:

CGRect CGRectMoveToCenter(CGRect rect, CGPoint center)
{
CGRect newrect = CGRectZero;
newrect.origin.x = center.x-(CGRectGetMidX(rect)-rect.origin.x);
newrect.origin.y = center.y-(CGRectGetMidY(rect)-rect.origin.y);
newrect.size = rect.size;
return newrect;
}

Base SDK Missing

I download the code "erica-iphone-3.0-cookbook-b8ca890" When I opn the examples appear 1 error "There is no SDK with the name or path 'iphoneos3.0'
I'm new in that.
Help pls.
I speak Spanish sorry for my poor English.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.