Wednesday, October 16, 2013

iPhone visit the Web site, information on how to get the iPhone

iPhone visit the Web site, information on how to get the iPhone, such as access to the currently set phone language
Java hoping to get, thank you.
Reply:
Unless submit data
Does not have a similar interface.
Reply:
That ability to obtain mobile browser language?
Reply:
headers

ios developed super group, communication between the master and the master, to those who indicate from CSDN: 43146334
Reply:
Get set language, can not it, lz can see what's inside header information, java should have the appropriate package, and it has nothing to do iPhone development, and only about java

tableview use of

I use the program to read sqlite two fields from the data are stored in the NSMutableArray (list and lsdetail)
By
[List addObject: item];
[Lsdetail addObject: tdetail]; added.
Then
cell.textLabel.text = [list objectAtIndex: row];
cell.detailTextLabel.text = [lsdetail objectAtIndex: row];
After execution discovery, tableview shows normal, but can not display detail data (already set the style Subtitle), but if
cell.detailTextLabel.text = [lsdetail objectAtIndex: row]; instead
cell.detailTextLabel.text = [list objectAtIndex: row];

detail can be displayed, what are the reasons, [lsdetail addObject: tdetail] sentence added to it seems empty characters, but can confirm tdetail has data, but add in as lsdetail after the string is empty?
Reply:
tdetail is what stuff?
Corresponding type of description method overrides yet?
Array added before, NSLog output to tdetail first look
 
NSLog (@ "Detail =% @", tdetail);




Reply:
Find a reason, which caused an NSMutableArray not initialized.
Not being given the run, alas If in vs no such troubles.
Reply:
2F reply quote:
find the reasons, which caused an NSMutableArray not initialized.
Not being given the run, alas If in vs no such troubles.


Dynamic languages ​​and static language differences
Reply:
In the development stage to be used for an array or a pointer assertion Yeah, the pro!

Apple's Developer Documentation

I just found this:
http://www.apple.com.cn/developer/mac/library/navigation/ios.html
But not what I want, I want to kind of like msdn documentation

Such as a class or object described those methods and properties, achieve anything, then there is sample code, but in apple development center turn for a long time did not find such content?
Reply:
http://developer.apple.com/library/ios/navigation/
IOS will not change the MAC. . . .
Make a point to a Web site: The above are good things http://code4app.com/category

Neighborhoods question about HTTP asynchronous request

Create a single View Application project, and then build a class that implements HTTP request data specifically designed to function
As follows, just write a function to achieve asynchronous call
- (Void) postDataInfo: (NSString *) nsPostVar: (NSString *) nsUrl: (NSString *) nsReferer
{
NSData * postData = [nsPostVar dataUsingEncoding: NSASCIIStringEncoding allowLossyConversion: YES];

NSString * postLength = [NSString stringWithFormat: @ "% d", [postData length]];
NSMutableURLRequest * request = [[[NSMutableURLRequest alloc] init] autorelease];
[Request setURL: [NSURL URLWithString: nsUrl]];

[Request setHTTPMethod: @ "POST"];
[Request setValue: postLength forHTTPHeaderField: @ "Content-Length"];
[Request setValue: nsReferer forHTTPHeaderField: @ "Referer"];
[Request setValue: @ "application / x-www-form-urlencoded" forHTTPHeaderField: @ "Content-Type"];
[Request setHTTPBody: postData];



self.Info = [[NSURLConnection alloc] initWithRequest: request delegate: [AppDelegate App]. viewController]; / / asynchronous processing, commissioned by Lord View receive information


}
Main view of
/ / All data have been received to trigger
- (Void) connectionDidFinishLoading: (NSURLConnection *) aConn
{
NSLog (@ "connectionDidFinishLoading");
}

Also created a new view, specifically to display data
In this viewController, I built a two timer to call postDataInfo
Follows
- (Void) postWonMoney
{
[[AppDelegate App]. ViewController.pwebOperator postDataInfo: Parameter 1: Parameter 2: Parameter 3];

}
/ / / / / / / / / / / / / / / / / View displayed when the implementation of this timer
[NSTimer scheduledTimerWithTimeInterval: (1) target: self selector: @ selector (responseInfoTimer) userInfo: nil repeats: YES];
- (Void) responseInfoTimer {
[Self postWonMoney] ;/ / can be successfully called here, to get the HTTP request data
/ / If here then set a timer, as
[NSTimer scheduledTimerWithTimeInterval: (5) target: self selector: @ selector (responseInfoTimer2) userInfo: nil repeats: YES];
}
- (Void) responseInfoTimer2 {
[Self postWonMoney] ;/ / Here call is unsuccessful, to get the HTTP request data
/ / Program executed self.Info = [[NSURLConnection alloc] initWithRequest: request delegate: [AppDelegate App]. ViewController]; collapsed
}
Is this what the reason, why in the implementation of the first timer there is no problem with it
Reply:
After the collapse of the command-line prompt information given what is?

Reply:
4th Floor reply quote:
after the collapse of the command-line prompt information given what is?

After the collapse of the program transferred here
@ Autoreleasepool {
return UIApplicationMain (argc, argv, nil, NSStringFromClass ([AppDelegate class]));
}
Behind Tip Thread 1: EXC_BREAKPOINT (code = EXC_I386_BPT, subcode = 0x0)
Command line without any prompting
Reply:
Executed
self.Info = [[NSURLConnection alloc] initWithRequest: request delegate: [AppDelegate App]. viewController];
A function of the received
/ / All data have been received to trigger
- (Void) connectionDidFinishLoading: (NSURLConnection *) aConn
{
NSLog (@ "connectionDidFinishLoading");
} Is not running when it was being given, there is not a delegate problems, which then create a TIMER TIMER, then the implementation of the second TIMER function inside to call will be a problem, if only one TIMER, then in the TIMER is Inside the function is executed there is no problem to call
Reply:
4th Floor reply quote:
after the collapse of the command-line prompt information given what is?

Executed
self.Info = [[NSURLConnection alloc] initWithRequest: request delegate: [AppDelegate App]. viewController];
A function of the received
/ / All data have been received to trigger
- (Void) connectionDidFinishLoading: (NSURLConnection *) aConn
{
NSLog (@ "connectionDidFinishLoading");
} Is not running when it was being given, there is not a delegate problems, which then create a TIMER TIMER, then the implementation of the second TIMER function inside to call will be a problem, if only one TIMER, then in the TIMER is Inside the function is executed there is no problem to call
Reply:
Let Ben collapse more fully some of the information given, refer to this: http://stackoverflow.com/questions/5386160/how-to-enable-nszombie-in-xcode

Reply:
May be caused by excessive release.
Need to output more debugging information, refer to:
http://stackoverflow.com/questions/5386160/how-to-enable-nszombie-in-xcode
http://stackoverflow.com/questions/2190227/how-do-i-set-up-nszombieenabled-in-xcode-4
http://blog.csdn.net/linzhiji/article/details/6771998
Reply:
9th Floor reply quote:
may be caused by excessive release.
Need to output more debugging information, refer to:
http://stackoverflow.com/questions/5386160/how-to-enable-nszombie-in-xcode
http://stackoverflow.com/questions/2190227/how-do-i-set-up-nszombieenabled-in-xcode-4
http:/ ......
command line gives the prompt for this
- [CFRunLoopTimer release]: message sent to deallocated instance 0x162ac330

Reply:
Friends with asihttp
Reply:
That problem has been clear. Is released, the object has been released, commonly known as "zombie object." To see that several Timer application and release.
Reply:
self.Info = [[NSURLConnection alloc] initWithRequest: request delegate: [AppDelegate App]. viewController]; / / asynchronous processing, commissioned by Lord View receive information

The front of each assignment, when will a Info release, while in front of the info request is still running, it will go wrong.
Recommend assignment before self.info call it cancel.
Reply:
12th Floor reply quote:
That problem has been clear. Is released, the object has been released, commonly known as "zombie object." To see that several Timer application and release.

Well, right, I follow the prompts predecessors, view CFRunLoopTimer release errors went TIMER problem, it really is the problem here, the second TIMER assignment when we must self. TIMER second object = XXXX , so there is no problem
Seniors can help me look at this display problem, thank you in the evening to pick stickers
http://www.cocoachina.com/bbs/read.php?tid=112855&page=1 # 670884

About PhoneGap environment configuration issues

The next step is very important! Put "www" directory is dragged Xcode4. You can not just be "www" folder into the application directory, but also dragged Xcode4 in! ! How to understand this sentence, I am afraid the next stupid, please adequate guidance
Reply:
Nobody replies to your ad?
Reply:
This is dragged into the time to choose create folder references for any added folders this option.
After the folder is dragged into it to be displayed as blue. (Usually the default is yellow).

】 【Ios ios concerning NSArray array of issues such as the collection

I often encounter a NSArray about memory problems, very puzzled, for example:
test.h
1, @ interface test: UITableViewController {
2, NSArray * documentArray;}
3, @ property (retain, nonatomic) NSArray * documentArray;
4, @ end

test.m
@ Implementation test
@ Synthesize documentArray;
6, - (id) initWithNibName: (NSString *) nibNameOrNil bundle: (NSBundle *) nibBundleOrNil {
7, self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil];
8, if (self! = nil) {
9, documentArray = [[NSArray alloc] initWithObjects: @ "aa", @ "bb", @ "cc", nil];
10, return self;}
11, .....

I am in the first three lines of code in the property uses retain, theoretically speaking, documentArray the retainCount has an up, so the first nine lines of code can be written:
documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil];

But sometimes write, program errors, and sometimes can not go wrong tangle ...
Reply:
retain, is the description of the property at the time the assignment, the value before the first release, and then assign a new value to the property, plus a reference.

Actually or 1. First assigned to it no problem, assign to it a second time have to be careful.
Reply:
 self.documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil]; 

Reply:
quote 1 floor reply:
retain, is a description of the property at the time the assignment, the value before the first release, and then assign a new value to the property, citing plus one.

Actually or 1. First assigned to it no problem, assign to it a second time have to be careful.

The heroes mean I basically understand, but want to confirm: For this post, in the. M file we should
With self.documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil];
Or self.documentArray = [[NSArray alloc] initWithObjects: @ "aa", @ "bb", @ "cc", nil];

2, asked what sometimes appears with an error it, I guarantee documentArray assigned only once (because of mistakes that practice, I just need to assign an unchanging set of array values ​​to use in the following UITableView in , so I'm sure)
Reply:
NSLog (@ "documentArray retainCount:% d", [documentArray retainCount]);
self.documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil];
NSLog (@ "documentArray retainCount:% d", [documentArray retainCount]);

NSLog (@ "documentArray retainCount:% d", [documentArray retainCount]);
self.documentArray = [[NSArray alloc] initWithObjects: @ "aa", @ "bb", @ "cc", nil];
NSLog (@ "documentArray retainCount:% d", [documentArray retainCount];
Results in two ways before the assignment, respectively, after the same (assignment before retainCount is 0, after 1)

Why is it wrong sometimes, tangled ...
Reply:
http://stackoverflow.com/questions/4636146/when-to-use-retaincount
Reply:
In fact, the use of the property, or the problem, and only when it is used self.documentArray = attribute, directly documentArray = is the assignment useless to the property.

self.documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil]; / / attribute to retain it, you need to release a second.
self.documentArray = [[NSArray alloc] initWithObjects: @ "aa", @ "bb", @ "cc", nil]; / / attribute to retain a bit, alloc have it, you need to release two times.
documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil]; / / do not retain and alloc, will be back with abnormalities.
documentArray = [[NSArray alloc] initWithObjects: @ "aa", @ "bb", @ "cc", nil] ;/ / alloc it, you need to release a second.

Actually, this means that your property (property) is not deep enough to understand. You can look at Apple this document, as well as some of the other online information.
https://developer.apple.com/library/mac/ # documentation / Cocoa / Conceptual / ObjectiveC / Chapters / ocProperties.html


Reply:
Novices usually encounter this problem, in fact, summed up or memory problems, even if you set the property, and then only when using the self to take effect. Do not put objects declared interface, and the use of property in the object retain equated, they are in fact has little to do. You can put the second line 2, NSArray * documentArray; removed, and then use the self.documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil]; so foolproof, or The third line @ property (retain, nonatomic) NSArray * documentArray; remove with documentArray = [NSArray arrayWithObjects: @ "aa", @ "bb", @ "cc", nil]; Or documentArray = [[NSArray alloc] initWithObjects: @ "aa", @ "bb", @ "cc", nil]; all OK.
Personal recommendations, unless the object to be used in another class, or do not set a property, for internal use, with the member variable enough, no need to use properties.
Reply:
Thank you, xiaowei4895 and Linux_fay two up.

uialertview problem

Every time I bring up a page's background will be black uialertview can remove the black ah Will
Reply:
Customize it with the kind of code instead of alertView pop animation.
Reply:
You print the current program window you will find all alertview actually added a new window and then alertView above in this window so that you can go to find blackened why. Problem can be solved ...

Qt module has been ported to iOS part

One day of hard work, successful transplant module QtCore, QtXml, QtNetwork, QtSql, toolchain is under linux, write about how to build a free development environment.
Gui module encounter point problem, free to continue to study.
gitorious on my clone the guy looks like a lot of transplants, but is engaged on mac, download link open.

I gitorius on projects: https://gitorious.org/ ~ ibingow / qt / ibingows-qt-ios-plaszma
Compiled libraries for download here: http://code.google.com/p/qtbuild/downloads/list
Reply:
I do not know what significance should have been up there? What the sdk ios good enough?
Reply:
Yes, you can let programmers easily accustomed qt iPhone development, but I think since the iPhone in place based on linux, then naturally qt is used in the above.
Reply:
lZ, is there transplantation tutorial?
Reply:
4th Floor reply quote:
lZ, is there transplantation tutorial?


No. Officials have the transplant, and we are waiting on the line

ALAssetsLibraryAssetForURLResultBlock return value

/ / Export images to a specified path
- (UIImage *) exportImage: (NSURL *) assetPhotoURL: (int) imageType
{
ALAssetsLibraryAssetForURLResultBlock resultblock = ^ (ALAsset * myasset)
{
CGImageRef imageRef;

if (imageType == SIZE_TYPE_THUMBNAIL)
{
imageRef = [myasset thumbnail];
}
else
{
ALAssetRepresentation * assetRepresentation = [myasset defaultRepresentation]; / / Big Picture
if (imageType == SIZE_TYPE_FULL_SCREEN)
imageRef = [assetRepresentation fullScreenImage];
else if (imageType == SIZE_TYPE_FULL_RESOLUTION)
imageRef = [assetRepresentation fullResolutionImage];
}

if (imageRef)
{
UIImage * image = [UIImage imageWithCGImage: imageRef];
NSLog (@ "Get Picture success");

/ / How to get pictures in return
}
};

ALAssetsLibraryAccessFailureBlock failureblock = ^ (NSError * error)
{
NSLog (@ "Get picture failed");
};

/ / Get the picture
ALAssetsLibrary * assetsLibrary = [[[ALAssetsLibrary alloc] init] autorelease];
[AssetsLibrary assetForURL: assetPhotoURL resultBlock: resultblock failureBlock: failureblock];

return nil;
}


The above code can get to the url specified repository picture object, but how to modify the code so that in their access to UIImage object can be returned directly, rather than through commissioned to return?
Reply:
You can use keyword __block, declare a variable to change its value in the block:
 
- (UIImage *) exportImage: (NSURL *) assetPhotoURL: (int) imageType
{
__block UIImage * image = nil;
ALAssetsLibraryAssetForURLResultBlock resultblock = ^ (ALAsset * myasset)
{
......
image = xxx;
}
return image;
}

Reply:
3rd Floor reply quote:
can use keywords __block, declare a variable to change its value in the block:
C / C + + code

- (UIImage *) exportImage: (NSURL *) assetPhotoURL: (int) imageType
{
__block UIImage * image = nil;
ALAssetsLibraryAssetForURLResultBlock resultblock = ......


This method does not work, I tried before, or will be returned empty UIImage

Lua using cocos2d-x and develop games (do not use box2d),

Lua using cocos2d-x and develop games (do not use box2d), how to build a framework of traditional cocos2d game framework are basically follows the MVC pattern, combined with lua after the MVC is not necessary to move on lua, or just give the M lua to do, there is no reference to their development process for the
Reply:
You mean on a mac lua?

The cocos2d I ask html5 but the results do not get out to follow the tutorial

I follow this tutorial to do
http://www.cocoachina.com/gamedev/gameengine/2012/0611/4345.html

Then this effect should have been, but I see only a blank page
Reply:
Did not file owner access.

dismissModalViewController will lead to the location of the parent view recovery how to do?

As follows, creates a view A, and A has been translated (by setting the bounds origin to achieve, because transform lead frame change)
Then presenModalViewController modal pop-up window, and then dissModalViewController to return to the original view.
The problem is that after A return to the original view, panning effect disappears, A view of the translational resumed before the appearance. Is there any way to stop this recovery operation?
PS: Personal tried in viewDidDisappear in record A bounds, and then to recover in viewWillAppear can get a similar effect. But seemingly
Unstable, so if there is a more standard or better solution would be greatly appreciated.
Reply:
It has introduced the sdk do?
Reply:
There is no check Resize View from Nib? The default is checked, you cancel the try?

Reply:
2F reply quote:
have not checked Resize View from Nib? The default is checked, you cancel the try?


I use Xcode4.2, builder has no Resize View from Nib this a way, corresponds to a UIViewController specific methods or properties that do?
Reply:
autoresizesSubviews = NO;
Reply:
Little prospect of a solution, and found that if the set UIViewController.modalPresentationStyle to UIModalPresentationCurrentContext, then dismiss the modal view does not change when the parent view bounds. But correspondingly has generated another problem: the pop-up window transition animation effects useless. Further studies, thank you ~
Reply:
Found with ordinary method is still difficult to solve, but very interesting is if the first instance of a UINavigationController, then their ViewController push into it. In this case, re-use ModalView without any problems, does not appear after the parent view to restore bounds dismiss the case. So now I use a navigationBar invisible NavigationController to circumvent this problem ...... very sick, but later on more familiar ground floor and come back ios solve it, mark down again.

How can I see the contents of the HTTP request

Help you next big cow
Now doing client-side interactivity needs and service parts. ,
The service side of said received request is empty. But I obviously have the following phrase, json string is also content.

request setHTTPBody: [json dataUsingEncoding: NSUTF8StringEncoding]];

Now want to print out the contents of HTTP, look I filled content. How we can now print out the contents of the HTTP request it?
Reply:
Ethereal, using a PC to do wifi ap, the PC connected to the network via lan, mobile phones even this ap, and then use software like wireshark capture
Reply:
Would that be possible to use objectiveC method implementation?

beginning ios5 development Chinese Version

Who beginning ios5 development Chinese version A, seeking to share A
Reply:
http://www.devdiv.com/iOS_iPhone-iOS_5_Programming_Cookbook% E4% B8% AD% E6% 96% 87% E7% BF% BB% E8% AF% 91% E5% 90% 84% E7% AB% A0% E8% 8A% 82% E6% B1% 87% E6% 80% BB -% E6% 9C% 80% E8% BF% 91% E6% 9B% B4% E6% 96% B08% E6% 9C% 8813% E6% 97% A5-thread-122853-1-1.html have an iOS 5 Programming Cookbook devdiv technical team is being translated, are the ios5
Reply:
I have downloaded, I did not want that book, but also wrote the great.
2F reply quote:
http://www.devdiv.com/iOS_iPhone-iOS_5_Programming_Cookbook% E4% B8% AD% E6% 96% 87% E7% BF% BB% E8% AF% 91% E5% 90% 84% E7% AB% A0% E8% 8A% 82% E6% B1% 87% E6% 80% BB -% E6% 9C% 80% E8% BF% 91% E6% 9B% B4% E6% 96% B08% E6% 9C% 8813% E6% 97% A5 ......

Xcode 5.0 How to add an exception breakpoint?

Want Xcode in the case of abnormal stop at the line error.
It is said that you can use the Add Exception point method, online tutorials Xcode versions are relatively old, I novice, now with 5.0 and tutorials do not know how to change is not the same, and beg you god help ah.
How to add an Exception Point it?


Reply:
xcode not to 5.0
cmd +6 Switch to breakpoint page, bottom left point on the + sign to add an exception breakpoint

IOS Baidu Location Map

IOS Baidu map positioning, arrived, but why, the map does not automatically move to my position, what do you want to set
Reply:
Your next point that little circle, it is centered.
Reply:
CLLocationCoordinate2D coordinate = userLocation.location.coordinate;
BMKCoordinateRegion region = BMKCoordinateRegionMake (coordinate, BMKCoordinateSpanMake (0.5, 0.5));
[_mapView SetRegion: region animated: NO];

ios how to plug in iCarousel album one selected by default

ios how to plug in iCarousel selected by default an album, the default is to choose the first one, a third example, I want all the default options, how to set default values ​​
This is the, iCarousel address https://github.com/nicklockwood/iCarousel
Reply:
Our idea is this: When iCarousel control is initialized, we put the second image in the default display in the middle, so, when the control initialization calls - (CGFloat) carouselItemWidth: (iCarousel *) carousel this approach, So we can be set in the method.
Code is as follows:
- (CGFloat) carouselItemWidth: (iCarousel *) carousel
{
/ / Initialize the time to set the default picture displayed in the middle of the second picture (index of 1)
[Carousel scrollToItemAtIndex: 1 animated: NO];
return ITEM_SPACING;
}

This method is not very professional feel and look forward to a more professional answer!

The boost asio socket api interface supports iOS do

The boost asio socket api interface supports iOS do? ? Previously compiled a boost, mac os x inside the test passed, ios link inside over time can not afford, not the whole feel of the environment is good, and now still take the environment can support? ? ? Do I have worked so hard to find out the whole can not support .......
Reply:
This was cross-compile it, google it, seems to have succeeded foreigners
Reply:
http://stackoverflow.com/questions/1577838/how-to-build-boost-libraries-for-iphone
Reply:
Has been tested, proven, it can be used, Kazakhstan

There is no way to achieve download in PDF to ibooks

There is no way to achieve, download a PDF to ibooks years, similar to ibooks in use synchronization software.
Now want to show the report in the software, click on the report allows the phone to browse the PDF of the report.
No problem under Andrews, apple we see can not be achieved, which is equivalent to PDF reports on ibooks directory.
Reply:
Should be it
Reply:
sftp on ok

IOS obtain documents folder problem

I wrote a program that needs to sandbox documents folder to share files with users,
Already. Plist file to set Application supports iTunes file sharing is YES
Get documents folder of the code is as follows:
NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentationDirectory, NSUserDomainMask, YES);
NSLog (@ "% @", [paths objectAtIndex: 0]);

Results:
/ Users / bingchanller / Library / Application Support / iPhone Simulator/5.0/Applications/C5006DC7-CC88-42F9-B02C-EB0CC686DB86 / Library / Documentation

That is not to obtain documents folder, but documenta then shared with the user in the app will be the right time for less than the correct path causes can not share files
Consult Great God this is what happens
Reply:
NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);

You set the read path wrong Oh, yes NSDocumentDirectory, not NSDocumentationDirectory
Reply:
http://blog.csdn.net/qijianli/article/details/7735422
NSDocumentDirectory documents is the path, NSDocumentationDirectory is Documentation path. The two are not the same.
Reply:
http://blog.csdn.net/qijianli/article/details/7735422
NSDocumentDirectory documents is the path, NSDocumentationDirectory is Documentation path. The two are not the same.
Reply:
I only see, learn
Reply:
After reading feel like upstairs. Also lamented, minor areas that success lies.
Reply:
 
NSString * documentsPath = [NSHomeDirectory () stringByAppendingPathComponent: @ "Documents"];

Gestures coordinates

Can drag gesture can obtain the time when a drag gesture between two adjacent distance it is not possible to set an intermediate variable to be calculated.
Reply:
If you use other methods to achieve using touchesBegain drag, you can be implemented as follows:
- (Void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
{
/ / Record the starting position, _ptMarked needs to be defined as a member variable
_ptMarked = [[touches anyObject] locationInView: self];
}

- (Void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event
{
CGPoint ptCurrent = [touches anyObject] locationInView: self];

/ / Calculate the current contact and the distance between the initial contact
CGFloat distance = sqrt (pow ((ptCurrent.x-_ptMarked.x), 2.0) + pow ((ptCurrent.y-_ptMarked.y), 2.0));
}

Read gb18030txt file can not be displayed

There is a txt file is gb18030 coding,
Thus read, get the string null value. data has a value, the path has value.
Estimated coding problem, ask how to solve this.

NSData * data = [NSData dataWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @ "about" ofType: @ "txt"]];
NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding (kCFStringEncodingGB_2312_80);
NSString * strContent = [[NSString alloc] initWithData: data encoding: enc];
Reply:
That change GB18030 encoding try

NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding (kCFStringEncodingGB_18030_2000);
NSString * strContent = [[NSString alloc] initWithData: data encoding: enc];

cocos2d-x to add GREE Platform

Looked at the document that emerged after the discovery document adds a strange phenomenon for the first time can be recompiled to wait until the second time in entering the GREE platform interface are not, code execution with no response, which is why, neighborhoods expert
Reply:
Understand gree of passing.
Reply:
Using cocos2d-x platform

Recommended wolf3d iphone game source code

Wolf3D game source code. Very suitable for iphone game developers learn to borrow.
Wolfenstein 3D using OpenGL for 3D rendering. You can learn how to id Software is how OpenGL rendering.

Download URL: http://www.okbase.net/file/item/3063 < br />
Reply:
Thank you for sharing! Remembered the former under DOS games, "Valkyrie"
Reply:
Yes, it's a good long way. Is the source code? Useful for what the game engine?

How to install Window's PC installed above the mac virtual machine for the iPhone? ? ?

If the installation window on the PC doing iPhone development aspects of the program, how to be in the computer need to install mac virtual machine, as well as the virtual machine you want to install the PC is no requirement to do
Reply:
vmware. still need a mac os installation disk.

Install a virtual machine on the pc memory requirement is as large as possible, cpu as well.
Reply:
Requirements so high ah, my laptop is a Dell product two years ago, the memory is only 1G, CPU is the Core Duo that year, is quite general, do not know can not support it. . .

uinavigationcontroller

In rootcontroller there is a tableview (with two A and B), click on one of the A to open new view (also a tableview, there are data C and D). Then click navigationcontroller top return, and then click the B, C, and still shows D. After clicking B has confirmed that data has been updated (it should be E and F), but the interface is still displayed on the A's data (C and D).


Neighborhoods should be done to show how the new data E and F? ?
Reply:
Are you a new view that the two should be the same view, populated with data when you judge what is now populated with the data? Tieshanglai see the code
Reply:
- (Void) viewWillAppear: (BOOL) animated
{
[Super viewWillAppear: animated];
[Self.tableView reloadData];
}

Reply:
viewWillAppear tried, to no avail

Since the code too much, probably this: http://blog.csdn.net/pjk1129/article/details/6561781

For example, after clicking A, uitableview interface display C and D, and then click back B, uitableview interface as if the data of the B E and F are appended, and instead of the original C and D cleared. But actually obtained after clicking B data is not included in the data A.

Maybe should'm asking the question: how clear the original data displayed in uitableview? With reloadData does not work.
Reply:
Carefully look at your tablecell spread click event in the next view of the data if they're right.
Reply:
If you are using uinavgationcontroller, after the return of that view once the view is destroyed, what about the data stored in it can be displayed again. Should be populated when you click on B data in question, a closer look after you click on B what used to fill the data.

URL you give others tableview are a viewcontroller inside. You said it yourself related to the uinavgationcontroller, should be two viewcontroller up, reloadData purely superfluous.
Reply:
Will be destroyed after the return of the original do? Seems to be no bar. Click A later pushViewController display the new view, and the view of the slider to the middle position; then return, click again to open the view A data is still displayed in the just return to the previous state. If it is destroyed, it should be the top-most display data bars.
Reply:
Are you sure you pass parameters yet? Since the two push the same view. Then you want to pass in front of this view are at least one parameter over. Then this latter view inside the talbe to know what data the load
Reply:
I used the stupid way to solve is to return after clicking on A, then click B after loading the data before using deleteRowsAtIndexPaths of the previous row (A data) can be fully deleted.
Reply:
You can use - (void) navigationController: (UINavigationController *) navigationController willShowViewController: (UIViewController *) viewController animated: (BOOL) animated {}

Then determine navigationController.viewControllers.count is equal to one to determine the current location is not in the root of

But now only judge that. . .

I do not understand, then email
yy.is.ing @ gmail.com

Players do not realize swf html5 video tag mp4 files play multiple problems playlist

First of all I would like to state in the absence swf conditions, for example, I make a video tag embedded inside pages, but requires the N broadcast video files, and this page can be opened directly iphne achieve continuous playback.

If you are using swf, flash player is basically the mainstream can be achieved playlist, but html5 implementation of

IOS message push

Recent study IOS push, there are several questions to ask them greatly.
 Push.payload (payload, "d :/ aps_development.p12", "123456", false, devices); 

In the above code requires five parameters, seeking advice
1, certificate problems. I now want to reach the goal is to push all the mobile terminal customized messages sent messages, so long as there is a certificate like this do?
2, device access, how to obtain customized message push mobile terminal device ah?


Reply:
A Look at the name of the certificate is the development version of the real need to use the on-line release certificate, each application a certificate
2.device token requires the client to access the server after a pass
Reply:
2 client access, and then upload the server, record user list.
Reply:
2F reply quote:
1. saw the name of this certificate is a development version and really need to use the on-line release of the certificate, a certificate for each application
2.device token requires the client to get passed to the service after the end

1, each application a certificate mean handset each install this application a certificate or install this application all use the same certificate?
2, device token client access to the server after the client, the server has put this device recorded in the database do? Or recorded elsewhere?
Reply:
3rd Floor reply quote:
2 client to obtain, and then upload the server, record user list.

After the client device token to the server-side access, the server side has put this device recorded in the database do? Or recorded elsewhere?

How to adapt to different pages iphone resolution.

Now there are two widths 320 and 640, will be how to adapt?
For example, when we designed the uniform in accordance with the width of 640, how to set the width of the viewport to make 320 automatic scaling?
Reply:
Solved. iphone with our resolution on the pc not the same, the actual is 320.

Click the login button to jump to login ViewController, why I do not jump it, to help look

 - (IBAction) btnLoginClick {
LoginViewController * loginView = [[LoginViewController alloc] initWithNibName: @ "LoginViewController" bundle: nil];
/ / UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController: loginView];
/ / [Self.navigationController presentModalViewController: nav animated: YES];
/ / [Self.navigationController pushViewController: loginView animated: YES];
[Self.navigationController presentModalViewController: loginView animated: YES];
/ / [Nav release];
[LoginView release];
NSLog (@ "aaa");
}


I also tried not commented out the line, or not moving, the console output of the aaa
Reply:
Yeah a lot of comment lines
Reply:
[Self presentModalViewController: loginView animated: YES];

navigationController should not initialize
Reply:
1. NSAssert (self.navigationController! = Nil, @ "nothing");

2. Breakpoint debug

Reply:
Controls are not bound class matter? ?

Who's push broadcast source, preferably a C # version, I do only a single push JdSoft.Apple.Apns.Notifications source

RT, thank you.
Reply:
Starting threads, go on and hair like the Well
Reply:
I just hope that this broadcast of PUSH, PUSH past as long as the broadcast from the server to perform APPLE send Perhaps it would be better, after all, by our client to connect to APNS this takes time, and if the broadcast made in the past, so more convenient, while APPLE side of the transmission efficiency is certainly high.
Reply:
Push notifications only one a hair, not "broadcast"

About two-dimensional code scanner zxing iphone use

I wonder if there looked into this a big cow, zxing download, compile ZXingWidget error, there is no one good translation, send me, thank you
My mail is: lishifeng2003@tom.com
I am learning iphone development, if there would be more appropriate to thank the
Demo
PS: When hair marked csdn convenient name scattered points
Reply:
Recommended ZBarSDK, there are sample code, scannable bar codes and 2D codes
Reply:
ZBarSDK how to support IOS3.X automatic scanning ah? Instead of manually oh. Looked under the official documentation says to set what USE_PRIVATE_APIS = 1 do not know how to set!
Reply:
quote 1 floor heavenopener reply:
recommended ZBarSDK, with sample code, scannable bar codes and 2D codes


Sample Code only scan the bar code, you have two-dimensional code scanning configuration source do? ? I still prefer zxing, because I used zxing on android, I feel good, I hope also used zxing iphone version
Reply:
zxing for iphone version also has code ah ⋯ ⋯
Their search
Reply:
ZBarSDK it is free
Reply:
3rd floor lsf304580500 reply quote:
quote 1 floor heavenopener reply:
Recommended ZBarSDK, there are sample code, scannable bar codes and 2D codes


Sample Code only scan the bar code, you have two-dimensional code scanning configuration source do? ? I still prefer zxing, because I used zxing on android, I feel good, I hope iphone version also used zxing


Sweep the same two-dimensional code. .
Reply:
zxing for iphone version seems to only support two-dimensional bar code
Reply:
Who sample source code, see the official dizziness, zxing compilation also reported a bunch of errors, say what you must ios sdk4.0 compiler, good trouble ah, who has compiled a good demo, send me extremely grateful ~ ~ ~
Reply:
Is now directly under the latest version 2.0 of their package, there are test items. You can build your own projects at the same level in this test project under the new directory, and add the same directory inside zxing plug-ins, you can run up.

ios path problem

NSString * path = @ "/ Users / glority / Documents /"; Path
NSString * path = @ "/ Users / glority / Documents"; File


ios existing methods to determine what path is the path or file

Thanks

Reply:
- (BOOL) fileExistsAtPath: (NSString *) path isDirectory: (BOOL *) isDirectory

objective-c of fget () reads the file, reads the contents of the less?

I'm learning objective-c based tutorial examples. Examples are as follows:
int main ()
{
FILE * wordFile = fopen ("D :/ word.txt", "r");
char word [100];
while (fgets (word, 100, wordFile))
{
word [strlen (word) - 1] = '\ 0';
NSLog (@ "% s is% d character long", word, strlen (word));
}
fclose (wordFile);
return 0;
}
word.txt line content is a string, the last line is the string "j"

But the output is not right "is 0 character long"
Why obviously have j, did not read?

Reply:
See my blog post:
http://blog.csdn.net/yang3wei/article/details/7856273
Reply:
2F reply quote:
see my blog post:
http://blog.csdn.net/yang3wei/article/details/7856273

Saw, with my like ah
Reply:
Ah ah ah ah ah ah, doing all these years of java, I did not expect from the new learn C, hey
To Pathwalker
Reply:
3rd Floor reply quote:
cited two floor Replies:
See my blog post:
http://blog.csdn.net/yang3wei/article/details/7856273

Saw, with my like ah

Bowen you what I get past the code inside a try, I guess the problem is that you have this wording,
Can not expect their little brains and hands do not move on the right problem to solve it?
Reply:
5th Floor reply quote:
references 3F reply:

2nd Floor reply quote:
See my blog post:
http://blog.csdn.net/yang3wei/article/details/7856273

Saw, with my like ah

Bowen you what I get past the code inside a try, I guess the problem is that you have this wording,
Can not expect their little brains and hands do not move on the right problem to solve it?

Wording is no problem, I also use their brains and hands
Reply:
You when I was just out of college ah?
Xiangxunjiuxun?
5th Floor reply quote:
references 3F reply:

2nd Floor reply quote:
See my blog post:
http://blog.csdn.net/yang3wei/article/details/7856273

Saw, with my like ah

Bowen you what I get past the code inside a try, I guess the problem is that you have this wording,
Can not expect their little brains and hands do not move on the right problem to solve it?

Reply:
landlord reply quote:
I'm learning objective-c based tutorial examples. Examples are as follows:
int main ()
{
FILE * wordFile = fopen ("D :/ word.txt", "r");
char word [100];
while (fgets (word, 100, wordFile))
{
word [strlen (word) - 1] = '\ 0';
......


LZ say is I do not know all the other words are not normally read, but only the last one J is not alone read.
If it is such a thing, it should be because
word [strlen (word) - 1] = '\ 0'; this sentence.
The last character changed to 0 that is '\ 0'

Reply:
The standard C library, there will be no functional problems.
fgets (word, 99, wordFile)
Reply:
I know what the problem
Because the last line with no line breaks, so
word [strlen (word) - 1] = '\ 0';
This sentence J to be deleted.

Could be a similar situation to the last row to add a line break it?
Reply:
 
int main ()
{
FILE * wordFile = fopen ("D :/ word.txt", "r");
char word [100] = {0};
while (fgets (word, 100, wordFile))
{
/ / Word [strlen (word) - 1] = '\ 0';
NSLog (@ "% s is% d character long", word, strlen (word));
memset (word, 0, 100);
}
fclose (wordFile);
return 0;
}

Reply:
11th Floor reply quote:
C / C + + code

int main ()
{
FILE * wordFile = fopen ("D :/ word.txt", "r");
char word [100] = {0};
while (fgets (word, 100, wordFile))
{
/ / Word [strlen (word) - 1] = '\ 0';
NSLog (@ ......

Uh, so seemingly impossible
The result is commented out phrase, except for the last line, the length of each line +1'
Reply:
14th Floor reply quote:
hey, LZ adults, do you want it?

Carriage return line is character ah, but it is not visible. So calculated is the actual data length.

If you try to turn carriage return line filter, and there is nothing wrong:

According to the above reply, each row (except the last row) the last one should be '\ n';

word [strlen (word) - 1] = '\ 0';

The following sentence is not changed on it:

if ('\ n' == word [strlen ......

String aaaa, I hope length is 4 instead of 5.
I think a lot of work this year people should know.
Otherwise, users will think the length is wrong, you say?

Your answer was I denied, but also do not be so frantic personal attacks against me.
Are the issues discussed during the work time is your right, people are not allowed to say it?
Of course, if you did not work, I understand your
Reply:
word [strlen (word) - 1] = '\ 0'; been overwritten, and that this position is the last character
Reply:
15th Floor reply quote:
reply quote 14th floor:
Hey, LZ adults, do you want it?

Carriage return line is character ah, but it is not visible. So calculated is the actual data length.

If you try to turn carriage return line filter, and there is nothing wrong:

According to the above reply, each row (except the last row) the last one should be '\ n';

word [strlen (word) - 1] = '\ 0';

The following sentence is not changed on it:

if ('\ n' ......



String "aaaa", then the length is 4,
The problem is, the file in which each line of data is not "aaaa", but "aaaa \ n",,

Not yet understand?

Do not understand the words facie ASCII table ......




Reply:
17th floor quote reply:
15th Floor reply quote:

Reply quote 14 Floor:
Hey, LZ adults, do you want it?

Carriage return line is character ah, but it is not visible. So calculated is the actual data length.

If you try to turn carriage return line filter, and there is nothing wrong:

According to the above reply, each row (except the last row) the last one should be '\ n';

word [strlen (word) - 1] = '\ 0';

The following sentence is not changed on ......


Do you think the user know that the unseen '\ n' is what you
Does the user input "aaaa" out of the length is 5, and he will think it is normal you
I say that the user user, I do not understand is that you now

iphone GPS location of mobile calls in addition to didUpdateToLocation, there are other ways?

I pass a callback function parses parameter acquisition to latitude and longitude information (latitude and longitude information is constantly changing value), in didUpdateToLocation display, showing only one icon, the icon does not move, and in didUpdateToLocation in print latitude and longitude information and callbacks in the latitude and longitude are not real (This shows data acquisition right). I had also tried ways, delete and add pins way to change the position, but this does not know what to show on the map?
Reply:
http://stackoverflow.com/questions/9746675/cllocationmanager-responsiveness
Reply:
4th Floor reply quote:
http://stackoverflow.com/questions/9746675/cllocationmanager-responsiveness
I have read , but that data is not what I want to find, of course, thank you very much.
Reply:
I want to know how to display the map MKMapView, how to display random latitude and longitude on a map the location, click the picture shows how the latitude and longitude information, how to make the icons on the map based on latitude and longitude to move icon on the map? My main question now is: how to make the icons on the map based on latitude and longitude to move icon on the map? There respondents, the score is not a problem.

Saturday, October 5, 2013

Local push the issue

Brother code:
UILocalNotification * notification = [[UILocalNotification alloc] init];
if (notification! = nil)
{
NSDate * now = [NSDate new];
notification.fireDate = [now dateByAddingTimeInterval: 10];
notification.timeZone = [NSTimeZone defaultTimeZone];
notification.alertBody = @ "test";
notification.soundName = UILocalNotificationDefaultSoundName;
notification.applicationIconBadgeNumber = 1;
[[UIApplication sharedApplication] scheduleLocalNotification: notification];
[Notification release];
}.
The question now is, the program in the background when you can pop a push notification, but the phone icon icon on the desktop program numbers can not be changed, which is why ah?


Reply:
Notified again when the refresh icon?
Reply:
Simulator problem, the real machine Ok
Reply:
Real machine OK, simulator issue. Khan -

UIButton not display title

 

btn1 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[Btn1 setTitle: @ "OK" forState: UIControlStateNormal];
[Btn1 setFrame: CGRectMake (10, 10, 100, 50)];
[Self.view addSubview: btn1];
[Btn1 release];



This is the source, why run, Button's title can not display it?
Reply:
Remove [btn1 release];
Reply:
quote 1 floor reply:
remove [btn1 release];


Useful, but why the release Button have problems? title is set up well before release
Reply:

Only the init UIButton only need to release.
Reply:
You did not give button alloc memory ah, release button, there is no future.

xcode 4.4 How is assigned directly to the tableview cell static values?

xcode 4.4 How is assigned directly to the tableview cell static values? Not removed from the database, every time my tableview cell when running on top are empty
Reply:
Using interface builder where properties can do
Reply:
quote 1 floor coderandroid reply:
use interface builder in the property can do

Resolved, the tableview cell is set to static cell can be

objective-c list type in a class how to define

For example in c #,, class a can define a list alist = new list ;
objective-c of how representation

Reply:
Use NSArray. But NSArray can not affirm what the inside is filled with the type of data.
Reply:
NSArray is fixed array, there is another variable, NSMutableArray
Reply:
NS (Mutable) Array + NS (Mutable) Dictionary combined on ok.
Reply:
C # in the list of list == OC in NSArray

Help: Using the PC serial commands to control IPod player

Need to use the PC's serial port to send commands to control IPod player, but for a long time, have not found the serial port (485,232) IPod header data transfer lines or related equipment, jars Has anyone done or know of such a thing , may wish to know to understand guidance about where there is such a data cable or adapter modules Or use other ways to achieve a similar IPod Windows application can control playback functions, where the first thank you.
Reply:
As long as both access to the Internet, you can write a PC client software interacts with the IPAD, the serial commands into the network command.
Reply:
This project has done much, in fact, ipad send commands to the pc pc serial
in the notification485,232 IPod data transfer cable, do not you want to plug in ipod with the line above it impossible ....
ipod via wifi send commands to the pc, pc distributed serial,
ipod can not directly control the serial port ... unless you really can plug in ipod lines above ...
Reply:
4th Floor reply quote:
this project done much, in fact, ipad send commands to the pc pc serial
in the notification485,232 IPod data transfer cable, do not you want to plug in ipod with the line above it impossible ....
ipod via wifi send commands to the pc, pc distributed serial,
ipod can not directly control the serial port ... unless you really can plug in ipod lines above ...

See IPOD serial data lines turn out plates and the IPOD serial data line itself with function!

objective-C method how to call between two viewcontroller

I would like to call in viewcontroller A method in viewcontroller B, how to achieve?
Reply:
viewController * b1 = [[viewController alloc] init];
[Self.navigationController pushViewController: b1 animated: YES];
[B1 release];
Reply:
oc is the object-oriented language, ah, use [object method];
General use delegate, do not recommend notice.

Reply:
Set up in the B final in a public function, and then the A in the argument to pass into it ~ ~

Issues relating tableview

Create a tableviewcontroller after some functions are automatically generated, how does this function (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath is when executed, viewdidload function is executed, but this is not executed, what is the reason it?
Reply:
When you set the tableview delegate = self, he will call the tableView delegate methods asynchronously.

sectionsIntable,
rowsInSection,
heightInIndexPath,
cellForRow ...
Reply:
- (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: (NSInteger) section this method returns 0 when you said that the method may not be executed
Reply:
- (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: (NSInteger) section this method returns 0 when you said that the method may not be executed
Reply:
3rd Floor reply quote:
- (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: (NSInteger) section this method returns 0 when you say that method may not perform

Thank you, ah, you're right, seems to be because there is not anything in my database. But I viewcontroller data stored inside the m-file record into the database, and NSLog it's true, why take this tableviewcontroller in m-file to take the time to go inside, but no data is it, this is why it

Apple has provided me informed of the player have previously installed my app interface it?

Done before an app, limited free 10 days or so has been downloaded more than 20 w, then transferred to the charge state.
But at that time only 40 points, recently decided to do an upgrade to this app, including image enhancement, bug fix, increase the number of checkpoints.
Here I am facing a problem, upgrade to take care of the old and new users.
We adopt such a strategy, the new user, then only 20 points to play for free, the other levels within the purchase manner.
If you upgrade to the new and old customers alike, then the previously downloaded this app old users, the upgrade to the new version of app after,
The number of checkpoints can play from 40 becomes 20, and so no doubt we must endure the old user curse.

In view of this, we decided to make a judgment, if it is previously downloaded the app user, then we gave him free to open 50 points,
In the previous 40 basis points more than provide 10 to play with him.
If you are a new user, then it is only 20 points to play with, so to solve the old problem of users getting mad.

Question is:
We learned that how a user previously downloaded this app do?
Apple officials have to provide the appropriate api what?
Alternatively, because the user had previously downloaded, then re-download our app even update, there is no way to determine whether the user is a new installation or update the old version?
Jiji Ji, expert help ~
Reply:
Will be purchased record has been purchased, and then tell you the results.
Multi-read, look, IAP relevant information.
Program itself is not remember.
Reply:
Unless you own the background tracking, recording equipment already installed, otherwise no way

Apple is not related to the api
Reply:
2F reply quote:
Unless you own the background tracking, recording equipment already installed, otherwise no way

Apple is not related api

Recording device UUID, can not it?
Seemingly heard previously allowed access to user device UUID, otherwise not allowed on-line ~
But I'm not sure, but there is to say
Reply:
quote 1 floor reply:
will be purchased record has been purchased, and then tell you the results.
Multi-read, look, IAP relevant information.
Program itself is not remember.


Apple users will buy time such data to see if there might be found in time of purchase of the API.
Reply:
With NSUserDefaults save the user setup information, as long as the user does not delete the app, there will be upgraded NSUserDefaults saved, so you can know that the user has not installed the

Input Form kinds of input box focus problem

I have a registration form with three input boxes, namely, name, email, password.

When you enter the name and email when the return key keypad is the NEXT button. I look forward to the effect that when the user selects NEXT,

Focus automatically moves to the next input box kind. For example, moving from a name to the email, and then move to the password input box.

password, ask how to achieve this?

When the password input box when the return key keypad is DONE key.

How can I capture the user presses the DONE key time to do this?

[Name becomeFirstResponder]; such a way, I tried, does not seem to effect ah.
Reply:
1 Set the input box delegate to self, the name, email, password changed to member variables
2 in the class to achieve self UITextFieldDelegate Protocol
In this method, the determination textfield name or email or password is to make a different behavior.

- (BOOL) textFieldShouldReturn: (UITextField *) textField
{
if (textFileld == name)
{
[Password becomeFirstResponder];
return YES;
}
if (textFileld == password)
{
/ / Process done
. . .
return YES;
}

}
Reply:
tried using this method, the situation is that when I finished oh the name field of the input, I NEXT, the keypad is hidden away, is still not in the next email box for input. However, depending on the UI feedback speaking, email field has focus if it is a. Because, adding email with text input box, then he would be clearly out of this operation.

Upstairs brothers, this problem can be solved incorrect? Online.

Reply:

I had originally written by a listener, the initiative calls resignFirstResponder caused.
Thank you, brother upstairs.

Why UIScreen access to the ipad and iphone simulator is the same size?

Why UIScreen access to the ipad and iphone simulator is the same size?

[[UIScreen mainScreen] bounds]. Size.width, [[UIScreen mainScreen] bounds]. Size.height

ipad and iphone simulator 320 and 480 are obtained
Reply:
UIWindow * window = [UIApplication sharedApplication]. KeyWindow;
Try
Reply:
Your targeted device family is the iPhone right choice.
Reply:
cited two floor taito reply:
your targeted device family is the iPhone right choice.

Select ipad is still the same

Select iphone / ipad is still the same
Reply:
Simulator itself, it did not choose to ipad
Reply:
Ipad simulator election is
Reply:
To edit project secting inside the selected job. Dizzy
Reply:
Will edit project secting Where?

6th Floor reply quote:
To edit project secting selected inside job. Halo

The GB18030 garbled zbar

As zbar does not support GB18030, so to recompile zbar source. I always use the mac compile error,
 configure: error: in `/ Users / imac / Documents / ios / zbar / zbar-0-1.10 ': 
configure: error: test for video support failed!
rebuild your kernel to include video4linux support or
configure - disable-video to skip building video support.
See `config.log 'for more details.

Engage in three days, help, who compiled successfully trouble Send me a copy 416678479@qq.com. If anybody has any other solutions troubles advise
Thank you
Reply:
Compile their own good, you need to look at my blog's shoes

Image Upload

I want the image to .png / jpg naming upload to ftp server, do not know how to engage, seeking god help you.
Reply:
This looks like it does not work and you have to pass nsdata data.
Define a protocol with the server, when you pass nsdata field is.
Reply:
I'm doing now is this: using a mobile phone camera, and then upload to ftp server.
I was doing: taking pictures, then the photo is written document, success; Then I read also successfully; Then I upload to ftp, I looked on the server, do have such a picture name, but I continue to point to open image , ftp prompts picture is empty.

Find great God explain why? ? ? Jiji Ji! ! !
Reply:
Refer to this: http://stackoverflow.com/questions/9672617/ios-basic-ftp-setup-read-and-write-stream

How to determine the main thread to read SOAP Webservice data end?

I want to read the background WebService SOAP method of data encapsulated in a class, but it sends a connection request and read data is asynchronous operation, but can also be read in several steps, only the execution to - (void) connctionDidFinishLoading: (NSURLConnection *) connection only indicates that the data has been read, then I know how in the main thread finished reading the data of it?

Thank you prawn, I am a novice. Preferably with sample code.
Reply:
Several options:

An agent
In the - (void) connctionDidFinishLoading: (NSURLConnection *) connection method in
[Delegate doSomting: data to be transmitted];

2 Notification
The place where you want to receive data register for notifications, in - (void) connctionDidFinishLoading: (NSURLConnection *) connection method in [[NSNotificationCenter defaultCenter] postNotificationName: xxxxx object: data to be transmitted];

3. . .

Reply:
Network requests into a separate thread, until after the end of the data requested by the commission notify the main thread.

Ask experts, ipad applications on artCircles in about two semi-circular set of pictures synchronized scrolling, text descriptions associated with the middle there, this is a way to show how to achieve? Seeking ideas or code.

No idea, terrible ah.
Reply:
Never used, but this is generally achieved through the property.

Changing UIView picture size, so that it can be accommodated UIView

iPhone development

UIView * images = [[UIView alloc] init];

images.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "strong spring beauty book - directory. png"]];

images.frame = CGRectMake (0,0,768,1024);

[Self.view addSubview: images];

After running discovery Picture "strong spring beauty book - directory. Png" display is not complete, only a part, ask the experts how to solve?
Reply:
iPhone development

Wrong setting big images.frame = CGRectMake (0,0,768,1024);

Instead images.frame = CGRectMake (0,0,320,480);

Reply:
Wrong, the iPad development
Ask the experts how to solve
Reply:
Add directly to uiview uiimageview uiimageview inside the image is the picture, and then set the size for uiview uiimageview size
Reply:
imageView.contentMode = UIViewContentModeScaleAspectFit;

The use UITabBarController

UITabBarController appDelegate which when added in the non-existence of the position will be offset downward
I am now a landing page does not require UITabBarController, after the successful landing pages only need UITabBarController,
Online to find some inside information that must be added in appDelegate offset downward position will not appear in the non-appDelegate inside pages do not use it?

Such as: landing page loginViewController, jump pages functionViewController, how do I do to add to
UITabBarControllerfunctionViewController leaving UITabBarController do not shift down, you reach people seeking a reasonable solution ~
Reply:
Seems to be using self.rootViewController = loginViewContoller;
Instead of [self.window addSubView: loginViewController];
Reply:
I just make a [self.window addSubView: loginViewController]; complete landing page Skip functionViewController added UITabBarController, there will be offset downward UITabBarController ~ ~ ~
Reply:
In fact, the problem is that the screen to jump. . .

You try a few pages to jump, or addsubview, insertview way to try on it

XIB file in either fixed coordinates can also be a

jrtplib the ios platform ported to

Such as the title, will be how transplant before they can be compiled jrtplib the ios platform using ah? Thank you ~
Reply:
Heard of this library is what to do with?
Reply:
I want to use rtp audio data is then sent packing, as if the library can use
Reply:
This library uses cmake compiled.
Reference here: https://code.google.com/p/ios-cmake/wiki/HowTo
Reply:
asked to use inside Sample_library under this part do?


Reply:
can be used under the guidance of the cmake how do? Thank you very much ah

iphone push group

I push information to multiple users, but how to get user information and object payload bound together push it? I use javaPNS. It is not the wrong place
Reply:
push the time to know the user's deviceToken, users can receive payload

CGRectMake use

CGRect myImageRect = CGRectMake (0.0f, 0.0f, 320.0f, 109.0f);
Why CGRectMake can be so used, and many other things need to use [CXXXObject alloc] in such a way?
Reply:
CGRect is a C struct, not an objective c object, objects need only objective in such a way alloc
Look at the definition of
CGRectMakeCG_INLINE CGRect CGRectMake (CGFloat x, CGFloat y, CGFloat width, CGFloat height)
{
CGRect rect;
rect.origin.x = x; rect.origin.y = y;
rect.size.width = width; rect.size.height = height;
return rect;
}
In fact, an inline function to generate this structure
CGRect

Child view how the specified position in the parent view displays ah

Such as the title, how to parent view subviews in the specified location display? My child views are half the size of the parent view, but a load of time, are covering the top part of the parent view, how could it not in the top display, ah,
Reply:
Set sub view of the frame property
Reply:
Remove the frame position set subview parent view at the top, but when you add subview need send to front.
[Self.view insertSubView: subview atIndex: 0];

Reply:
Do not understand what you mean.
Reply:
CGRect parentBounds = parentView.bounds;

CGFloat x = parentBounds.origin.x;
CGFloat y = parentBounds.origin.y + parentBounds.size.height / 2;
CGFloat width = parentBounds.size.width;
CGFloat height = parentBounds.size.height / 2;

subView.frame = CGRectMake (x, y, width, height);

/ / The above parentView is the parent view, remember to take bounds, rather than the frame, because the child view is a view in the parent relative coordinate system relative to the parent view instead grandfather view coordinate system. Normally these two coordinate systems are the same, but if the same is not scaled.
/ / SubView that you want to display subviews

Reply:
You simply need to do bounds.

Complex, you can see the resize in uikit
A word that is not clear

Mac how to use the terminal under the build cmake jrtplib the ah?

As stated jrtplib download the source code, know to use cmake to compile, also installed, but it is not in the mac terminal pondering how to use, I hope someone gets advice ~ Thank you ~
Reply:
Like to see introduced did not say support IOS. But you can put directly on the source code used in the project to try.



ios developed super group, to those who indicate from CSDN: 43146334
Reply:
Go directly into the source code ah, someone gave me a link you can use cmake compiled ~
quote 1 floor reply:
like to see introduced did not say support IOS . But you can put directly on the source code used in the project to try.



ios developed super group, to those who indicate from CSDN: 43146334

nsstring How to convert hexadecimal nsdata

posts by zzxap on 2012-08-31 11:13:28 Edit
120831040158

Every two converted into hexadecimal nsdata should be

C81F413A

12 into hexadecimal nsdata should be C
Reply:
First look at your string is not all decimal numbers it?
If this is enough to say.
Reply:
All characters are decimal digits
Reply:
Although this requires weird, but still can write a loop transformations look
Reply:
int int converted into hexadecimal and hexadecimal NSString very simple

But I just do not know how to convert an int to hex NSData
Reply:
Basic situation:
1 cycle, according to two characters taken out, makes up an integer.
2, will be an integer in the spell converted to the corresponding character added to the string

In fact, so simple a process, you can try to do something.
Reply:
7F reply quote:
basic situation:
1 cycle, according to two characters taken out, makes up an integer.
2, will be an integer in the spell converted to the corresponding character added to the string

In fact, so simple a process, you can try to do something.

Is nsdata not a string, I have written. . With byte

How will the project under xcode base sdk version changed from 5.1 to 4.3?

Recent contact with a new project, the development process is always encountered inexplicable bug, was discovered later that sdk version of the problem.


That project development time using xcode_4.0.2, base sdk is 4.3, and my xcode is 4.3.2, the default sdk is 5.1, so I want to configure it to default into xcode 4.3. Tried it, the simulator can be turned into 4.3, but the base sdk only 5.1 unchangeable. To change can only download 4.0.2 version of xcode, it seems, and sdk xcode are bound.


So I let my colleagues gave me pass xcode_4.0.2_and_ios_sdk_4.3.dmg, when prompted during installation, I have to be an operating system os x 10.6.6 job and my current system is 10.7.4, xcode can not be installed. . .


And Baidu a moment found that if I want to change the current system to 10.6, then you have to reinstall the system. . . . .


Which experience some pointers to the younger ah, do not reinstall the system in addition to no other recourse than to the What?
Reply:
Personally do not think the SDK version of the problem, the problem is definitely your code, but you want to change the SDK is also possible, as follows:

Dmg first opened, do not install,
Double / Volumes / Xcode and iOS SDK/Packages/iPhoneSDK4_3.pkg


Reply:
Themselves from the old version of the above the "iPhoneOS4.3.sdk" copy the entire directory to
"/ Developer / Platforms / iPhoneOS.platform / Developer / SDKs /" directory

Restart Xcode 4.3 can change baseSdk it.

ipad where system log files, the program suddenly quit, how to see the error message

RT, IPAD suddenly quit the program above, the system log file where
Reply:
The iPhone link computer, the error log will be synchronized to your computer through iTunes,
Error log storage address is:

Mac OS X: ~ / Library / Logs / CrashReporter / MobileDevice /
Windows XP: C: \ Documents and Settings \ \ Application Data \ Apple Computer \ Logs \ CrashReporter \ MobileDevice \
Windows Vista: C: \ Users \ \ AppData \ Roaming \ Apple Computer \ Logs \ CrashReporter \ MobileDevice \
Windows 7: C: \ Users \ \ AppData \ Roaming \ Apple Computer \ Logs \ CrashReporter \ MobileDevice \


Error log file name format
MobileNotes_2012-07-04-144523_xu-chuangmato-iPhone.crash

MobileNotes indicate name of the application crashes.
2012-07-04-144523 represents the point in time of the collapse occurred at 14:45:23 on July 4th, 2012.
xu-chuangmato crash the device name indicates.
ios crash suffix indicates that the error log.
Reply:
You are using Xcode programming do? Already synchronized program on the IPAD can not see the system log! ! !
Reply:
2F reply quote:
you are using Xcode programming do? Already synchronized program on the IPAD can not see the system log! ! !

Then how do ah, immediately exit the program went wrong, wondering what is wrong ah
Reply:
xcode's organizer corresponding device inside the console can be seen
Reply:
4th Floor reply quote:
xcode's organizer corresponding device inside the console you can see

Thank you, I try
Reply:
Mac OS X: ~ / Library / Logs / CrashReporter / MobileDevice /

My computer is not following CrashReporter folder thing
No MobileDevice this folder

Reply:
6th Floor reply quote:
Mac OS X: ~ / Library / Logs / CrashReporter / MobileDevice /

My computer is not following CrashReporter folder thing
No MobileDevice this folder
Some shadow possession but were you with the console cd / Library / Logs / CrashReporter / MobileDevice / can open

ipad UITableView's section headerTitle development issues

[Img = http://my.csdn.net/my/album/detail/1287872] [/ img]
ipad development, in the realization of a UITableView multiple section when assigned to each sction headTitle when the teacher assignments on both sides, as shown above.
1.
- (NSString *) tableView: (UITableView *) tableView titleForHeaderInSection: (NSInteger) section {
NSString * str;
if (section == 0)
{
str = @ "website subdomain";
}
if (section == 1)
{
str = @ "List Library";
}
return str;
}
2.

/ / - (UIView *) tableView: (UITableView *) tableView viewForHeaderInSection: (NSInteger) section
/ / {
/ / UIView * viewSection = nil;
/ / If (section == 0)
/ / {
/ / / / ViewSection = [[UIView alloc] initWithFrame: CGRectMake (10, 0, 300, 20)];
/ / ViewSection = [[UIView alloc] init];
/ / ViewSection.backgroundColor = [UIColor clearColor];
/ / / / UILabel * textSection = [[UILabel alloc] initWithFrame: CGRectMake (10,2, 140, 20)];
/ / / / / / TextSection.text = @ "website workspace";
/ / / / TextSection.textColor = [UIColor clearColor];
/ / / / TextSection.backgroundColor = [UIColor clearColor];
/ / / / TextSection.font = [UIFont systemFontOfSize: 20.0f];
/ / / / [ViewSection addSubview: textSection];
/ / / / [TextSection release];
/ /
/ /}
/ / If (section == 1)
/ / {
/ / ViewSection = [[UIView alloc] init];
/ / ViewSection.backgroundColor = [UIColor clearColor];
/ / / / UILabel * textSection = [[UILabel alloc] initWithFrame: CGRectMake (10,2, 140, 20)];
/ / / / / / TextSection.text = @ "List Library";
/ / / / TextSection.textColor = [UIColor redColor];
/ / / / TextSection.backgroundColor = [UIColor clearColor];
/ / / / TextSection.font = [UIFont systemFontOfSize: 20.0f];
/ / / / [ViewSection addSubview: textSection];
/ / / / [TextSection release];
/ /
/ /}
/ / Return [viewSection autorelease];
/ /}

Reply:
Figure Where?
Reply:
quote 1 floor reply:
figure in what?
how Cato, I put on the blog's album chart, and then The address on the link in the wrong?
Reply:
See Figure ah! !

Combination of MVC and kvo

I want to do a little game, with the MVC pattern

M and C linked through kvo, M changes, V be notified
I do not quite understand is, V change, M be notified updated M, M is modified, then do not turn notify C to update V do? This is not to become a cycle yet
Reply:
1. View triggered by a button in the view controller via IBOutlet call the corresponding action
2 In the action to get some label.text modified model
3. Model modified by kvo updated UI, where the UI does not include the trigger source

In other words, the trigger of the view controller is no need to observe model, just outside the associated changes in model view controller to get the issues, so usually in kvo adding a source, if self == source direct return swap, which means that you have dealt with before.
Reply:
1. Button click to update notification C M in labeltext
2. Labeltext change notification through kvo label C to update the UI

You said judgment source == self is what step to do?
And here's self is what object?


Reply:
MVC is a pattern, which is relative to the framework for the entire project, not an object, a key question of the relationship;
KVO is technical, it means adding an observer only, the observer is to observe him the value of the monitored key value is changed, changing the operation to do what you do operations, regard him as the MVC pattern is the concept of fuzzy problems ;

cocos2d-x 2.x Touch range settings

How to Touch range is set in a sprite will move on.
Reply:
Put this package into a sprite moving object, so that access to this object after touching agency inherited CCTouchDelegateTarget. You can see the official documentation of specific tutorial test.

visual studio 2010 New cocos2d-x project each run are missing header files

New cocos2d-x project each run are missing header files, find a solution.
1> Creating directory "E: \ study folder \ MyTest01 \ Debug.win32 \".
1> InitializeBuildStatus:
1> Creating "Debug.win32 \ MyTest01.win32.unsuccessfulbuild" because "AlwaysCreate" was specified.
1> ClCompile:
1> main.cpp
1> e: \ study folder \ mytest01 \ mytest01 \ proj.win32 \ main.h (11): fatal error C1083: Cannot open include file: 'CCStdC.h': No such file or directory
1> HelloWorldScene.cpp
1> e: \ study folder \ mytest01 \ mytest01 \ classes \ helloworldscene.h (4): fatal error C1083: Cannot open include file: 'cocos2d.h': No such file or directory
1> AppDelegate.cpp
1> e: \ study folder \ mytest01 \ mytest01 \ classes \ appdelegate.cpp (1): fatal error C1083: Cannot open include file: 'cocos2d.h': No such file or directory
1> Generating Code ...
1>
1> Build FAILED.
Is the source code every time the beat up several folders do?
Reply:
Put your items on the cocos2d-x libraries under. Or you are in a good vs works specified in your library, in the library test over.
Reply:
In the build phase plus connect just fine

iPhone application to access. / directory file failed

I have two iPhone works. Are written in pure C calls *. A static library. This static library has a function to play log files, access the / directory.

One (Project 1) the creation of normal log.txt file names written content.

Another (Project 2) can not successfully create the file, an error is returned Permission denied, that is, without permission.
I put all the code works 2 copied into a project, delete the original project a code
It is to use a framework to accommodate engineering works two write code. Compilation finished, normal access. / Directory and write files

I carefully examined the two project configurations, did not see what the problem is.

My system is XCode3.2.5 & iPhone SDK 4.2
Using code signing is iPhone Developer, which is the kind of crack the code signature.

Ask the experts, this is what causes.


Reply:
. "/" What? . App directory is not written permission.

vmware installation mac card logo

As stated in the installation process read online: http://www.chinaz.com/web/2011/0727/201872.shtml
What pre-hardware check, I are OK, but the last virtual machine is started, unlimited stuck in apple logo, not like the beginning tutorial select a language, what time?
What is the reason?
Or can anyone give me a tutorial on it? Including the need for the iso image, etc.
Reply:

http://bbs.pcbeta.com/

Vision Forum to look at it, there are few research systems installed.


Reply:

VM is to find a 8.0 or later, install a Mac support patch.

Then change the iso, or dmg try it. After installing the patch mac, VM can be installed directly from the dmg file.


Reply:
3rd Floor reply quote:
VM is to find a 8.0 or later, install a Mac support patch.

Then change the iso, or dmg try it. After installing the patch mac, VM can be installed directly from the dmg file.


I used a ready-made mac system, you can run, but no Internet access, as well as full-screen Huaping
http://www.chinaz.com/web/2011/0727/201872.shtml
The above provides a solution Huaping patch, but after a lot of open pkg file, how to patch?
Or access to the Internet -
Reply:
Just use the virtual machine can not be installed on a mac how to open a chat window QQ ah a close watch on solving
Reply:
How to put on? I also stuck in LOGO here!
Reply:
I have encountered such a problem, they had to change the boot image just fine

uiwebview on some of the issues

On the ipad
On the left is the navigation on the right is uiwebview, but the search results out too long, you want to do a page, the original idea was to do two in uiwebview transparent buttons, like the QQ news to see pictures of that effect, but seemingly a bit difficult.

Then think of it, there seems to pull the slide, you can pull the next page, this is an event you ask? If the trigger is an event how do?

Each time the trigger I just want to write in this event a fixed number of queries, this will not be too long nor too slow
query
Simply put it is the uiwebview paging
Reply:
Did not understand what you mean you is to search out the results above are displayed in UIWebView? Search results are plain text or above? UIWebView is sliding ah.
Reply:
That can slide, but above all in the page content, ah, this is not thousands of pieces of data are in it, and has been down for a long time, so just want to do a paging
Reply:
Seems to be judged uiwebview offsets. If you exceed certain limits on the re-load the second page of data
Reply:
Your data is that the link or text? As too is a plain text, then you can do it yourself a paging algorithm then displays a page, but if it is linked to the words Actually, we can do, just a little bit complicated. You can also embed js do.
Reply:

UIWebView you use this load url will put all the pages have content taken down, and you have not shown the interface does not matter

Do you want pagination should instead ios background to achieve this end
Reply:
Slide the event has been occupied, sliding across uiwebview are pulling
Reply:
To use two button solve it, find a better location
Reply:
Apology "Paginate html file in UIWebView, UIWebView paging" a text with detailed description and source code.

Go to:
http:// love crazy phone .tw/node/2012-09-19.htm
http://appholic.tw/node/2012-09-19.htm

Focus is:
Conclusion: Paginate html file in UIWebView, UIWebView paging looks very difficult, in fact, only one line, iOS4.x: "((UIScrollView *) subview). PagingEnabled = YES;", iOS5: "self.webView.scrollView.pagingEnabled = YES;. " At this time, each page will slide from the top or bottom of the screen, so ,2012-09-19. Htm file domestic use for some css3, mainly "-webkit-column-width: 320px;" This setting column of css3, will 2012-09-19.htm horizontal paging.

Jesse

To figure how much cut Ipad pixels?

An Iphone version of the application you want to make an Ipad version,

Slice is not have to follow the amplification.

Iphone top one is 320 * 480 and a * @ 2x.png 640 * 960.

Ipad need much cut above diagram it?
Reply:
1024 * 768

Reply:
1024x768
retina is two-fold, just find the app ipa unzip it to have a

iphone how his own received message prompts on the taskbar to display to the user?

My iphone, every once in a while access webservice server, some messages from the server, if you get a message once the information received would put the tips on the taskbar, and then slide down the user click on the message, enter the message display. But I do not know how to achieve? Seeking ideas and methods.
Reply:
First you have to support APP push function, and then you back-end processing business after processing to the client sent push
Reply:
This message push needed to handle the job

freetype2 display problems

I used to write the same code FREETYPE2 WIN32, IOS, ANDROID compiled by the same code, display size are not the same, I tested official website provides sample2.cpp compiled into various platforms, word size are not the same, Ask the experts how to do
Reply:
Hello, this is normal ah;
Like a simple file, in win32, mac, liux shown above are not the same size; This display refers to the size of files take up disk; and
Binary data file size is not the same.
Because, for binary data, you just move to another system, there is no change, then they are the same;

This, you know under a different file systems, such as FAT32, NTFS, HFS, EXT3 and the like, to understand the sector, to understand the data storage methods, and you will understand.
For example, NTFS format, you can set the minimum size of the sector, such as 4KB, you'll find a 100-byte file that looks the size is 4KB.
Reply:
I mean the kind generated font sizes
Reply:
This and pitch about ah. They dpi different pixel sizes are different, the same size screen display size naturally occupy different, so you will look different. You put under windows into different dpi setting, the program displays your windows out of the same size are also different word size.

uitextview display problems

UITextView * txt = [[UITextView alloc] initWithFrame: CGRectMake (100, 100, 600, 500)];
txt.text = @ "grebggreberbjeorbnevoenbineoribneiornboiernbioernbioernboiernboiernboienroirnboiernbioernboiernbiorenbioneronboernboreinboirenboboirengioerngoeringeornbroienoienbioenboenoeirbnoierbnoiernbeorvernioenboernboerinboirenbiofnborneoeinoenoenoeirnoiernoenoenoe";
txt.textColor = [UIColor redColor];
[Self addSubview: txt];

Have to drag about this control, the content can be displayed. The same code in other test programs can be displayed properly.
Who knows, Thank you!
Reply:
No, because you do not have to instantiate UITextView after adding view.
The [self addSubview: txt]; into [self.view addSubview: txt];
Reply:
How do you drag?
Reply:
Try to re-layout the current view about
 
UITextView * txt = [[UITextView alloc] initWithFrame: CGRectMake (100, 100, 600, 500)];
txt.text = @ "grebggreberbjeorbnevoenbineoribneiornboiernbioernbioernboiernboiernboienroirnboiernbioernboiernbiorenbioneronboernboreinboirenboboirengioerngoeringeornbroienoienbioenboenoeirbnoierbnoiernbeorvernioenboernboerinboirenbiofnborneoeinoenoenoeirnoiernoenoenoe";
txt.textColor = [UIColor redColor];
[Self addSubview: txt];
[Self setNeedLayout] ;/ / re-layout

In IOS4 on how to use OpenGL?

Before I use GLKView development, and found GLKView is IOS5 new out, you can not work on IOS4, is there any other alternative to do?
Reply:
Be sure to run on ios4?
Reply:
cocos2d-iphone.org

gogogo
Reply:
EAGLView

objective c alloc address 0x00000000

Heroes, help!

Custom FirstViewController f;
f = [[FirstViewController alloc] init];

f The address is 0x00000000, because there are lazy or something what, why ah?
Reply:
FirstViewController * f = [[FirstViewController alloc] init];
Reply:
Sorry, this clerical error, the program does not crash Baocuo No, only in the class in creating this address 0x00000000, some methods can be called normal
Reply:
Heroes, help!

Custom FirstViewController * f;
f = [[FirstViewController alloc] init];

f The address is 0x00000000, because there are lazy or something what, why ah?


Sorry, not for this reason, a typo!
Reply:
Class init method rewrite yet?



ios developed super group, to those who indicate from CSDN: 43146334
Reply:
You get him into that place a chant nil
Reply:
0x00000000 == nil bar

mac under myeclipse how to adjust memory

Now works a little big, memory is always enough.
Reply:
Hard, do not know how much memory your machine.
Originally, I was 2G, very card; later added a 2G, everything smoothly, do not want to change the system.
In fact, sometimes, it almost changed the world all changed.
Reply:
In fact, this is the mac system memory management strategies and windows caused by different;
For individual users, under normal circumstances:
2G memory is the same, you will find some of the cards on the system mac, windows system is slightly smoother;
However, 4G memory, the system is very smooth in mac, windows is a little smoother.

mac system wants smooth, is to be conditional.
Reply:
With the requirements under mac how to allocate memory ~
Reply:
8G memory .... not so much to consider
Reply:

there is an eclipse eclipse.ini file, which can be used to modify the program memory, LZ facie Myeclipse is not there a similar configuration file

eclipse.ini file reads as follows:
-Startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
- Launcher. Library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-Product
org.eclipse.epp.package.java.product
- Launcher. DefaultAction
openFile
- Launcher. XXMaxPermSize
256M
-Showsplash
org.eclipse.platform
- Launcher. XXMaxPermSize
256m
- Launcher. DefaultAction
openFile
-Vmargs
-Dosgi.requiredJavaVersion = 1.5
-Xms40m
-Xmx384m

Reply:
The change can be considered, xmx and xms
Reply:
mac if you use the following default path installed, the configuration file in

/ Users / username / Library/Genuitec/MyEclipse-8.6/myeclipse.app/Contents/MacOS/myeclipse.ini

Memory size modified:

-Xmx1280m
-XX: MaxPermSize = 512m
-XX: ReservedCodeCacheSize = 128m

This should be no problem, try not a myeclipse inside open multiple large projects, or remove the automatic compilation

How do I clear uitableview existing content?



2012 (Fall) CocoaChina thematic review
Developers Conferencewhile (sqlite3_step (stmt) == SQLITE_ROW)
{
char * mess = sqlite3_column_text (stmt, 2);
NSString * addList = [NSString stringWithUTF8String: mess];
[ListOfMovies addObject: addList];
}
Through the contents of the database program will loop join table control, you want to control through the program and then clear the contents, you need to reload the data, how to empty the table data in the control

Reply:
http://blog.csdn.net/column/details/sqlite.html

Program runs when suddenly flash back

In Console prompt message is
Sep 20 17:03:59 unknown com.apple.launchd [1] : (UIKitApplication:-55Crwon.demoTwoDevice [0x7917]) Job appears to have crashed: Segmentation fault: 11
Sep 20 17:03:59 unknown SpringBoard [27] : Application 'demoTwoDevice' exited abnormally with signal 11: Segmentation fault: 11

I was in a real machine above debug, because a novice and do not know how to find an error, we ask a? ? XCODE wrong information indicated rarely seems like VS, error is that it can quickly narrow the scope of
Reply:
From the beginning of the file
main.mBreakpoints, step by step
Reply:
quote 1 floor reply:
main.m file from beginning
A step breakpoint

Real machine above debug can also set breakpoints do? When a crash can not automatically jump to the wrong place?
In the long run the program should appear when the occasional flash back
Reply:
Memory leaks are generally the type of problems it
Reply:
More than 90% of the problems are memory problems
Reply:
4th Floor reply quote:
90% or more of the problems are memory problems

Want to know how to see the collapse of the information, and then through the crash information to determine the location code, wondered not
Reply:
Look what actions you performed to find reproduce the steps, and then be able to determine the approximate problem areas, then break point to debug, gradually narrowing the range, and then be able to find.

ios how to get CPU usage

As stated, I used the cpuusage UIDevice-hardware method to get to the cpu usage value, but small fluctuations in the data, with the operation of some occupied cpu cpu values ​​will not rise up, online access to information regarding the ios cpu usage rarely are other platforms, you have any methods or ideas where you can share with you, we can discuss my thoughts just now getting each process id, then read each cpu occupied by id usage, but the specific implementation methods have not yet, I hope you have any ideas to share, thank you friends
Reply:
xcode-> open Developer Tool-> Instruments can be selected to monitor the CPU
Reply:
http://hi.baidu.com/_violet_moon/item/c27bcf3d3d1cb3677d034be2

One on ios iPhone / iPad real-time access cpu, memory, hard drives and other usage of the article, try do not know can not be used
Reply:
Upstairs This only gets the memory size has no access to the CPU, but the method should be similar, close
Reply:
LZ question and answer, and no help, no research in this area.

Reply:
4th Floor reply quote:
LZ question and answer, and no help, no research in this area.


Make a note, you can look after yourself, ios CPU access much information
Reply:
iphone developed through unix systems underlying acquisition and system-related hardware information

http://blog.csdn.net/arthurchenjs/article/details/6261776
ArthurChenJS write a blog
Reply:
Upstairs information just get to memory usage.

 
- (Float) cpu_usage
{
kern_return_t kr;
task_info_data_t tinfo;
mach_msg_type_number_t task_info_count;

task_info_count = TASK_INFO_MAX;
kr = task_info (mach_task_self (), TASK_BASIC_INFO, (task_info_t) tinfo, & task_info_count);
if (kr! = KERN_SUCCESS) {
return -1;
}

task_basic_info_t basic_info;
thread_array_t thread_list;
mach_msg_type_number_t thread_count;

thread_info_data_t thinfo;
mach_msg_type_number_t thread_info_count;

thread_basic_info_t basic_info_th;
uint32_t stat_thread = 0; / / Mach threads

basic_info = (task_basic_info_t) tinfo;

/ / Get threads in the task
kr = task_threads (mach_task_self (), & thread_list, & thread_count);
if (kr! = KERN_SUCCESS) {
return -1;
}
if (thread_count> 0)
stat_thread + = thread_count;

long tot_sec = 0;
long tot_usec = 0;
float tot_cpu = 0;
int j;

for (j = 0; j {
thread_info_count = THREAD_INFO_MAX;
kr = thread_info (thread_list [j], THREAD_BASIC_INFO,
(Thread_info_t) thinfo, & thread_info_count);
if (kr! = KERN_SUCCESS) {
return -1;
}

basic_info_th = (thread_basic_info_t) thinfo;

if (! (basic_info_th-> flags & TH_FLAGS_IDLE)) {
tot_sec = tot_sec + basic_info_th-> user_time.seconds + basic_info_th-> system_time.seconds;
tot_usec = tot_usec + basic_info_th-> system_time.microseconds + basic_info_th-> system_time.microseconds;
tot_cpu = tot_cpu + basic_info_th-> cpu_usage / (float) TH_USAGE_SCALE * 100.0;
}

} / / For each thread

kr = vm_deallocate (mach_task_self (), (vm_offset_t) thread_list, thread_count * sizeof (thread_t));
assert (kr == KERN_SUCCESS);

return tot_cpu;
}



This method can get to the percentages, there are fluctuations, but the value is not accurate, and occasionally jumps to more than 100