You can do this:
[[textView layoutManager] usedRectForTextContainer:[textView textContainer]].size
You can do this:
[[textView layoutManager] usedRectForTextContainer:[textView textContainer]].size
If you get this error when trying your app on the device, you have PNG compression on in Xcode, in Xcode 4 goto “Build Settings” search for PNG in the search box and turn off PNG compression…
This was happening because I accidentally deleted “Bundle Display Name” from my info.plist…..
- (NSString *)escape:(NSObject *)value {
if (value == nil)
return nil;
NSString *escapedValue = nil;
if ([value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSMutableString class]]) {
NSString *valueString = (NSString *) value;
char *theEscapedValue = sqlite3_mprintf("'%q'", [valueString UTF8String]);
escapedValue = [NSString stringWithUTF8String:(const char *)theEscapedValue];
sqlite3_free(theEscapedValue);
} else
escapedValue = [NSString stringWithFormat:@"%@", value];
return escapedValue;
}This is very simple, even though I can’t find so many resource regarding this online; follow these steps:
1- Download the latest version of Lua from: http://www.lua.org/ftp/
2- Obviously unpack it and find the “src” folder.
3- Delete the files: “lua.c”, “luac.c” and “print.c”
4- Grab the “src” file and drop it in your project’s left pane, under your projects’s name along with “Classes”, “Resources” etc.
5- Rename this newly added “src” to “lua”
Now you should be able to follow these types of tutorials:
http://www.ibm.com/developerworks/opensource/library/l-embed-lua/index.html
Hope this works for you!