AMD Turbo Dock For Future Children
Baca Selengkapnya ....
this tutorial I will show you how to compress and decompress files from their iOS apps. We will use a third party library called ZipArchive to achieve this. While there are some solutions out there to compress and decompress files, I think ZipArchive library was the quickest and easiest way to get started.
‘s a big problem. There are a number of reasons why you may want to support compression and decompression of files from within your applications. Here are some examples:
Apple App Store download 50MB Cap
Apple introduced a download limit of 50MB via 3G in apps downloaded to appease carriers and not monopolize your entire band. One way around this is to keep your binaries very small, and transfer resources to their application needs. The best way to package these resources is obviously a zip file. Thus, the process (as you will see demoed below), is to open your application, check the updates of Resources to download the zip file and unzip it. Now you can send smaller applications, which recovers its resources dynamically.
dynamic updates to contentI talked about this above. When your application needs updating assets is common to present an update to the App Store. This may take up to a week to Apple for review and publishing. A faster method is to close their assets and put them on a server somewhere (even your Dropbox) and have your app download and unzip them. That way when you want to do asset-based changes in the program, you need not submit a copy of it to the store.
Download Zip files from the Web
A big fall Safari and Mail app is, they are not open zipped files. It would be nice to offer some kind of support to show zipped file on the device. Many of the “download” apps in the store to support this process, and you can too with a little help from ZipArchive.
Note: No support ARC
If you use an ARC enabled project, you must tell the compiler not to use ARC to ZipArchive. To do this, click the project in the left column. Then click on your target in the middle column and select “Build phases” tab.
Expand “Gather Supplies” area, locate ZipArchive.mm and double click it. In the box that appears, type -FNO-objc-arc and click Done.link libz
The last step is to link your project to libz.1.2.5.dylib . Construction screen you sailed above link expand binary library and click the “+” button to add a new library. Look for libz.1.2.5.dylib list, select it and click Add.
Now compile the project and he would succeed without errors. One thing to note is ZipArchive can produce some warnings, they are no big deal, but if you’re a Nazi warning (which should be), dig into the code and see if you can solve them alone.
The sample project has a vision like this:.
It is basically a UIImageView and UILabel. Inside View Controller IBOutlets raised for these two items. Be sure and download the sample project to see the implementation details. We will download a zip file from the web that contains an image and a text file which you can see displayed in the image above. When unzipped, the image is set to the visible image of our textual content UIImageView and i txt file will be displayed inside the UILabel.
** 1. Import headers ZIPARCHIVE ** class = “code”> # import "ZipArchive.h" class = “code”> style = / / 1 = dispatch_get_global_queue ( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ) , dispatch_async ( queue, ^ { NSURL * url = [ NSURL URLWithString @ " http://www . icodeblog.com / wp-content/uploads/2012/08/zipfile.zip " ] NSError * = null , / / 2 NSData # * data = [ NSData : url options 0 wrong: & #] if ( wrong) { / / 3 NSArray = ( NSCachesDirectory, NSUserDomainMask ) , NSString * path = [ 0 ] NSString * [ stringByAppendingPathComponent Path: @ "zipfile.zip" ] , [ : zipPath options : 0 wrong: & error ] , if ( wrong) { / / TODO: Extract } a61390; “cor: # else { ( ” Error saving the file% @ “ style = “color: “> else { ( ” Error downloading the zip file :% @ “, 002.200, “color: #) , } } 002200; “cor: #) Creates a transmission queue to run our code on the default priority. quick and dirty way to get data from the web. Resolve the path to the cache directory and print the transferred data to a zip file locationNow that you have
downloads the file to disk, it is time packaging store and use the content.
third Unzip the downloaded fileThe last step here is to unzip the file you just downloaded. To be clear, it saves the path / Library / Caches / zipfile.zip and when extracted, the content to be included in the folder caches too.
Change / / TODO: Pack in the above code with the following code: class = ZipArchive * = [ [ Alloc ZipArchive ] ] / / 1 if ( [ : ] 002200; "cor: #) { / / 2 BOOL = [ UnzipFileTo za: Path Replace ] , if ( NO == ) { } [ ] / / 3 NSString * [ stringByAppendingPathComponent Path: @ ] , NSString * = [ stringByAppendingPathComponent Path: @ "text.txt" ] NSData * = [ NSData : : 0 null ] , * = [ ] , NSString * # string text = [ NSString : text encoding file path NSASCIIStringEncoding wrong: null ] , / / 4 ( ( ) ^ { = img; self. . = string text, } ) . Opens file and unpack it in memory Writes the contents extracted to a certain path ( caches folder) uses the extracted files Update UI (the wire, of course) with new data downloaded.It's really very simple.
closing files Now you will see how to go the other way and closing some files on the hard disk. Again, this can be especially useful when you want your users to share groups of files via the web or email. If you have completed the steps above, your cache folder has some files out there that we can just close it again and send away. Let's close the two files that you are pre-packaged, stuff them into a new zip file and print it to the file directory. In my sample project, I created a new button at the top that says "zip" that links to a IBAction called zipFilesButtonPressed: when tapped. This is where I will do zip: class = "code"> - ( ) : ( ID ) sender { / / 1 NSArray * = ( NSDocumentDirectory, NSUserDomainMask, Yes ) , NSString * = [ paths will 0 ] , / / 2 = ( NSCachesDirectory, NSUserDomainMask, YES ) style = NSString * cache path = [ : 2400d9; "color: # 0 ] / / 3 NSString * zipfile = style = # [ " newzipfile.zip " ] "> / / 4 * [ [ #] ] , [ ] , "> / / 5 NSString * = [ : @ " photo.png " 002200, "color: #] NSString * path = text "style 002200; "> @ " text.txt " ] "> / / 6 [ : @ "NewPhotoName.png" ] style [ # : # @ "NewTextName.txt" ] "> / / 7 BOOL = style = # [ ] , NSLog ( @ "Compressed% d result" , the success ) }Here's what's happening:
resolve the path to the documents directory. We will need this in determining the road to write our new zip file. resolve the path to the cache directory. This is used to retrieve the files to be zipped. Zip file determines the way we print. ZipArchive instance object and tell it to create a new "in memory" zip file. Note that the file is not printed until you call the method corresponding CloseZipFile2. The zip resolve the path to the files to be zipped. add the file archives. You can add as many files as you want here. You can also add directories (ie you could have put the entire cache directory if you wanted). Print zip file and close it. Just to test, we recorded the results to ensure that zipping managed.After running through the program, tap "zip" button, look for the Documents folder of the application (located ~ / Library / Application Support / iPhone Simulator / [iOS version] / Applications / [Unique ID] / Documents]. should contain a single zip file called newzipfile.zip. If you unzip it, you should see the two files that you put in it is extracted. Conclusion
Congratulations iCoding
Download sample projects XTZ
::: http://www.icodeblog.com/2012/ 08/13/unzipping-files-using-zip-archive / :::
As I mature as a developer, I try to trust others, AOS code further. Why build something from scratch when a solution since you can fit into your projects. In MUD Pocket Pro, I used 13 libraries 3 and I use a little more in the projects that I, OMA currently working. I thought I’d share some of the libraries that I used so you can save some time in the future.
Many of my program involves TCP or UDP network. There are a lot of boiler plate code involved in each network application, and CocoaAsyncSocket solves much of that to you.
Hopefully you have heard of a gift or a similar library now. There, AOS very challenging for users to want to review your application, much less give it a positive review. AppiRater you can ask the user to evaluate your application based on both the number of launches or events Äúsignificant, au that you specify.
I’m trying to send small applications that retrieve assets at launch. A great way to send these assets over the wire is to zip them and put them on your server. I wrote an article about it in iCodeBlog.
Creating Forms in iOS is very painful. It usually involves custom table cells and very absurd delegate. Dialogue Quick takes some pain and allows you to easily create forms iOS. You can also create them using JSON.
Often you want a quick and dirty browser in your application. I usually use it to point to the in-app documentation, or take the user to a page by pressing a link. TO quickly and easily.
I hope you find some value in the list. I’d love to hear about the ODA library you uses frequently.
Happy coding! http://www.icodeblog.com/ 2012/08/24/5-third-party-ios-libraries-i-have-found-useful-lately ::: / :::Recently I came across an OpenGL ES 2.0 engine that made the installation, display and animate 3D objects a breeze, called NinevehGL. The 3D engine has many features including a full multithreading environment, to keep the main execution loop is free to object rendering, motion tweening, grouping items, lighting, materials and textures, custom shader support and native support for reality increased, just to name a few. Another great advantage is the possibility to import both wavefront (. Obj) and Collada (. DAE). This structure is very easy to use, robust, and can be used in many different ways.
iOS openGL rotating earth with NinevehGL Erick Bennett on Vimeo.
In this tutorial I will show how easy and effective way to add an OpenGL ES 2.0 3D view of the project, and show a fully rendered, 3D rotating Earth. The active model can be found here, and includes object and texture. These assets are also in the ZIP file of the project, available through the link at the end of this guide. Download and install the framework NinevehGL. Since we want to add this view to an existing project and understand how the engine works, you can create a new project unique view to start. Even NinevehGL could very well be using Interface Builder, let’s put this view programming. For this exercise, no matter if you choose Storyboard or XIB for the new project. For starters, there are some tables that we need to add. Do this by first choosing your header file in the project browser pane design. Ensure project goals is highlighted, and build phases click “Link Binary with Libraries of.” Use the + at the bottom of the screen and add this Core Quart and open Pringles frames.Then use the “Add Others” button, navigate to the folder and downloaded NinevehGL NinevehGL.framework import .
Now in code ……. NinevehGL import the header (h). file
@ Controller Interface View: UIViewController NGLViewDelegate > # import # import @ interface View Controller: UIViewController NGLViewDelegate > NGLCamera * _camera, NGLMesh * _mesh;}your source file (. m), which you should start NGLView puts his delgate that can define a glossary of some basic definitions and start networking and cameras. I do this in my viewDidLoad method, but depending on your needs, this can be done elsewhere
- (void) viewDidLoad {[super viewDidLoad]. Style # = / / Do any additional settings after loading the view, typically from a point / / set our NGLView * TheView = [[ NGLView Alloc] initWithFrame: CGRectMake (40, 40, 240, 360)], / / Set the delegate thus call display method used = theView.delegate himself. / / Add new view on top of our existing view [self.view addSubview: TheView]. / content / is used to increase the resolution to useof monitors the retina and the values range from 1.0 to 2.0. This sets the scale factor content
best to scale screen of the device. theView.contentScaleFactor = [[UIScreen main screen] scale], / / Set some initial states to implement our environmental mesh NSDictionary * settings = [NSDictionary dictionary object with keys sand: kNGLMeshCentralizeYes. , kNGLMeshKeyCentralize , @ "0.3" kNGLMeshKeyNormalize ], nil. / / initialize the network, which includes the template file to be imported (or DAE .. obj) _mesh = [[ NGLMesh alloc] initWithFile: delegate settings :: @" earth.obj "] nil; / / Initialize the camera used to make the scene _camera = [[ NGLCamera Alloc] initWithMeshes:. _mesh, nil], "cor: # 008000 / / If a transparent background necessary NGLView / / theView.backgroundColor = [color UIColor course] / / nglGlobalColorFormat (NGLColorFormatRGBA) / / nglGlobalFlush () / / The following command displays a 3D view Status Monitor, which displays your current frame rate and the number of polygons rendered in sight. [[ debugMonitor] starting order: ( NGLView *) self.view ];}
-. (Void) { / / Rotate on Y axis _mesh.rotateY + = 0.5, / / Draw for our camera to show our point of view [_camera tie camera];} Now, build and run the project and you should see a slowly rotating planet Earth. The NGLView was deliberately designed smaller than the bottom view to show how you can override this on all normal NGLView another to add 3D content. If you want the background to be transparent NGLView, set the background color to clear and add the following additional commands. There is also a status monitor that can be executed to display the frame rates and the number of polygons performed for optimization.project file
pc Canadian Pharmacy brahmi
:::::: http://www.icodeblog.com/2012/09/07/3856/
Introduction
recently here at ELC, we are working on an application that requires a lot of server interaction, which has been a learning experience for managing threading, server load and connectivity. To maintain application performance and agile when you send a large number of applications and aggregate a large dataset, our group had to intelligently manage and prioritize network interactions.
Here NSOperationQueue help. This class is highly dependent on Grand Central Dispatch (GCD) to run NSOperations (in this case, the HTTP requests and JSON SERIALIZATIONS). These operations can be performed in various settings, including simultaneously and asynchronously. In this tutorial I will show you how to make a block-based queue using NSBlockOperation operations, a concrete subclass of NSOperation. You can use this client server class to manage all interactions with the external server. To demonstrate this, our Twitter sample issue for a set of tags and keywords to return the results asynchronously. The sample code is available on GitHub . Let’s get started. Client Server Setup
First, create a class Media Server with a property transaction queue. This class is a singleton server because we want to route all network requests from a single file operation.
talks with NSBlockOperation
Now we are ready to start our business line. In our example, we will search for tweets that contain different keywords, so just need a get method in our class server
Note. Since the blocks are syntactically somewhat hard to read, it may be appropriate to assign typedef parameters of an input block and returns. This also means much more readable to cross the block. In our example, we expect a number of objects tweet, and we should look for errors in the HTTP request and JSON serialization. In MediaServer.h, add:
class = "code"> class = typedef void ( ^ ) ( NSArray * items NSError * wrong) class = "code"> class = - ( ) : ( NSString * ) String Search block : ( FetchBlock 002200; "cor: #) Lock, { * [ transaction block NSBlockOperation blocks with : ^ { NSMutableArray * = [ [ NSMutableArray ] ] , NSError * null , NSHTTPURLResponse # * = null , NSString * = [ String Search stringWithURLEncoding ] , * = [ NSString string with the format : @ = [ : [ : ] #: #] , NSData * = [ NSURLConnection : query response returned : & Error response span style : & ] , NSDictionary * = [ : 0 : & ] span style NSArray * = style = # [ @ ] / / Serialize JSON response Tweet light convenience items to ( NSDictionary * in / "color: =) { Tweet * = [ [ ] ] , [ : #] , } NSLog ( @ " Search "% @"% back in profit . " String, Search, [ count] ) / / return to the main queue, once the request has been processed [ [ NSOperationQueue #] : ^ { if (> ( null , error span style ) , more ( tweetObjects, span style zero ) , } style = #] } ] , / / You can also set the priority function This is useful when flood / / operation with different preferences [ #: ] , [ if addOperation operationQueue ] , #} research Canceling Tweet
In some cases, you may want to stop the activities of its queue, for example, when the user navigates away from a view that displays the contents of various requests servers. this example, when the user hit back " Tags "button, we want to avoid crossing other queries This is as easy as:.
class =" wp_syntax ">
class =" code "> style = # - ( void #) : ( BOOL ) excited # { Media Server * = [ ] , [ [ ] "cor: # 002200] , #}
competition
The only fetchTweetsForSearch: block: do is create a business and submit it to the queue, so back almost immediately The main advantage of this method is that all work within the operating block. occurs in a background queue, leaving the wire free and ensure the UI is responsive. To confirm this works, you can open the profiles of time instruments (a very useful tool for improving UX) and check the queue block running.
In the profiles, you'll see that initWithJSON : , JSONObjectWithData: options: error: and sendSynchronousRequest: return Response: error: ... all running on a worker thread ship, the red wire is not exactly what we want
Conclusion
There you have as a developer you will get the maximum benefit from this server paradigm when you send a large number of URL requests or when the user is on a slow network. If you run into situations where the queue full of desires, remember that you can prioritize their activities, such as
class = "code"> [ : ]Congratulations iCoding
Source Code -! GitHub
http:/ .. ::: / www.icodeblog.com/2012/10/19/tutorial-asynchronous-http-client-using-nsoperationqueue / :::
role selection list until you see "Day to synchronize e-mail."