Archive 2010


CaptureView: capture a UIView

o UIImageView ) in modo rapido. CaptureView allows you to clone, as an image, any view ( UIView or UIImageView ) quickly. (quindi visualizzato). What you get is an object CaptureView that can be used as a normal UIView (then displayed). Capturing the "screen", or any portion thereof, may be useful in many cases. Once the new "image", it can be manipulated without preoccparsi of its content.
Often you have multiple nested view and Carry out or processing effects on the mother's view that contains them all is not always an optimal solution.

Continued ...

jQuery snippets

Verify the existence of an element in the DOM

There will ever need to check the existence of an element of the DOM. With jQuery could be spontaneously try:

Continued ...

Common Queue, a simple solution

In asynchronous environments, where method calls or events are released daily bread (see Adobe ActionScript or Objective-C), often the same sequence of operations is not identical to the thousandth of a second. In addition, multiple methods can I call a more general function with the risk to cancel the effect of the other one o'clock.

To clarify the concept of a prime example. Environment is often used to activate the iPhone network indicator on the status bar, indicating that there is - precisely - "traffic" network, that you are performing a download or upload (downloading or sending data).

Continued ...

Variety of coding and coding in Objective-C ...

It was a bit 'that dealt with the subject , so I take this opportunity right away. Here are several ways to accomplish the same result in Objective-C. To you to discover what is the fastest and best!

Reverse an array

1
2
3
4
5
6
7
/ / To be implemented in a category
/ / Puts the elements of an array in reverse order
NSMutableArray * ) reverse { - ( NSMutableArray *) {reverse
int i = 0 ; i< ( floor ( [ self count ] / 2.0 ) ) ; i ++ ) for (int i = 0; i <( floor ([self count] / 2.0)) i + +)
i withObjectAtIndex : ( [ self count ] - ( i + 1 ) ) ] ; [ExchangeObjectAtIndex self: the withObjectAtIndex: ([self count] - (i + 1))];
return self;
}

Continued ...

WordPress: retrieve the contents of private pages

Allocation from the post WordPress: retrieve the contents of a page to add some information. First of all, you can retrieve the contents of a page using a function like this:

1
2
3
4
$slug ) { getPageBySlug function ($ slug) {
get_page_by_path ( $slug ) ; ObjectPost get_page_by_path = $ ($ slug);
"the_content" , $objectPost -> post_content ) ; return apply_filters ('the_content', $ objectPost -> post_content);
}

Continued ...

WP 2.7 Bannerize

New major upgrade to WP Bannerize , now in release 2.7. Excluding any bug fixes, I think this will be the last release that will make in 2010! We define an early Christmas present. This latest version introduces a lot of requests (such as impressions or scheduling by date) reported by users and the full list you can read it in detail here .

Continued ...

Very short snippet: increment a field in SQL

The latest release of WP Bannerize I introduced a new field in the table shows how many times a banner is "clicked". To perform the operation valore = valore +1 I used in SQL:

1
`campo` = `campo` + 1 WHERE id = id_record; UPDATE table SET `field` = `the` + 1 WHERE id = id_record;

Continued ...

10 useful snippets Objective-C

Move the double-tap on the simulator

The simulator iPhones / iPad Xcode allows you to simulate the double tap the Alt key is pressed. This is useful to simulate the function of Pinch, that used to enlarge or scroll Keep away content in the view with objects or UIWebView . Well, some of you have noticed that the simulation of the "two fingers" proceeds in a symmetrical manner always starting from the center of the screen. To move this "center" is also just hold down the SHIFT key.

Continued ...

Objective-C: handle multiple animations with a single setAnimationDidStopSelector

è estremamente versatile, come già visto in setAnimationDidStopSelector: usi diversi ed avanzati . The setting of the end of animation, executed with setAnimationDidStopSelector , a class of UIView is extremely versatile, as seen in setAnimationDidStopSelector: different uses and advanced .
Let me now show you a technique very convenient when we have multiple animations and / or want to manage the queues (queue) of animations.

Continued ...

Objective-C: subclassing and Categories

In Objective-C you can extend a class given in two ways: by running a classic subclassing (see also inheritance) or using the so-called categories .

Note: there is also a third way in Objective-C indicated by the name of Posing we might call a mix of subclass (because it defines a new name) and categories (for a given moment all classes of one type behave like new) .

Continued ...