UIImageView or UIView Blast Animation

Hi guys today we are going to work on some UIImageView animation we can apply this animation on UIView or any subclass of UIView. First of all we create a new project

You will have to add UIView+Explode these files in your project. These files are Created by Daniel Tavares and i found in a source code.

Now you just have to

  • Make a block
  • Create an ImageView
  • Assign Image to Image View
  • Animate on a tap gesture
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-(void)setTappedGestureWithBlock:(GESTURE_Tapped)block
 
{
 
self.userInteractionEnabled = YES;
 
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
 
tap.numberOfTapsRequired=1;
 
[self addGestureRecognizer:tap];
 
objc_setAssociatedObject(self,&GESTURE_BLOCK,block, OBJC_ASSOCIATION_COPY);
 
}

 

  • Call  [weakSelf lp_explode];

Now you may download the complete project for better understanding click here 

How to create a new project in XCode

This post is just to let you guys know how to create a new project in Xcode 4.x. So First of all open the Xcode from your Applications folder or search “Xcode” in spotlight. When xcode is opened now you have to follow these steps

  • Click on “File” available in the top bar of your screen
  • Go on first line “New” and then select project
  • A window will open with some options

Select template

  • Select any templete according your requirements but ion most cases we select “Single View” and customise it according our own requirements.
  • Select a suitable name for your project and then click on “Next” according the following image

Write a project name

  • Select a suitable place for your project and click on create.
  • If you want to create a local git repository for this project then Check “Create local git repository for this project ” and then click on create.

and you are done with it. You have created a new project successfully. Happing coding and Mind Your Code

 

 

Find word in UIWebView or access UIWebView contents or how to use javascript in iOS project

UIWebView, HI Guys today we are going to explore UIWebView. We will see how we can access the text or contents in a UIWebView. In this regards we’ll find some word in the given text in an html and will highlight those words otherwise an alert “No Match found” will be shown.

First of all we will create a new project with a single view named “FindInWebView”.

2nd step is to add a new UIwebView in view of our ViewController.

connect this web view with an IBOutlet named “myWebView”.

We do not have enough rights to perform operations on UIWebView directly so in this regard we will use methods of JavaScript. SO lets see how JS find a word in some html file. written below are some methods to find a word and highlight and remove highlight.

Continue reading

Enable or Disable ARC on single file in a Project

ARC (Automatic Reference Counting) was introduced in iOS 5.0 SDK.
Although there is no difference in the execution of an ARC program and a well written MRC (Manual Reference Counting), it is good to use ARC if it is annoying for you to manually keep track of reference counting of objects that you create. On other hand using ARC also decreases your line of code count.

But leaving all the advantages or disadvantages aside, during your iOS development experience you may fell into a situation when you want to enable or disable ARC base compilation for one or more files in a project but not the complete project.

You don’t have to do any hack for this just simply
1 – Go to TARGETS.
2 – Select Build Phases.
3 – Click the small arrow left to the text Compile Sources. It will open up list of all the .m files of your project.
4 – Double click the file name for which you want to enable ARC and just write this flag -fobjc-arc and you are done.
Likewise if you want to disable ARC for any file just write the flag -fno-objc-arc then this file will be compiled as a MRC file.

This images summarises the whole story in a single short.
Screen Shot 2013-04-10 at 1.18.21 AM

Now keep enjoying ARC and Mind You Code.

Debugging in Classic Asp

Classic Asp is kind of old fashioned or even a historical language for some folks but if you are a part of a team which is responsible for maintenance of a huge application, you have to live with Classic Asp and its limitations. Because Asp is a server side language so we have to enable Server side debugging from IIS.

IIS

There are different techniques used for debugging classic Asp code. Let’s take a look of them.

Writing Debug Messages

It is the most basic, easy but childish way of debugging classic Asp. You use Response object and print values of your desired variables all over the page.

Creating Macro

It won’t allow you to step into DLL files for obvious reasons, but I am sure it’s more efficient than writing debug messages to diagnose the issues.
Here is a small process of using this technique.

  • First of all, check if you have enabled server side debugging from IIS. If you haven’t then just do it by having a look as above screen shot displays.
  • Create a macro by choosing View->Other Windows->Macro Explorer.
  • Record a new Macro and paste the hooking code in the body of this macro.
  • Save the macro.
  • Hookup the debugger with IIS by opening a Browser and open any .asp page. This will load the iisprocess in the memory.
  • Run your macro, it will automatically hook with this process in memory.
  • Now open the asp page you want to debug.
  • Set a Break Point in the code (in active tags ofcourse
  • Browse to your page and it will automatically break at the break-point!

 

hooking code goes here

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Sub ClassicASPAttach()
 
Try
 
Dim os As System.Version = System.Environment.OSVersion.Version
 
Dim IISProcess As String = "w3wp.exe"
 
If os.Major = 5 And os.Minor < 2 Then
 
IISProcess = "dllhost.exe"
 
End If
 
Dim processFound As Boolean = False
 
Dim process As EnvDTE80.Process2
 
For Each process In DTE.Debugger.LocalProcesses
 
'Determine if the process could the IIS worker process
 
Dim processName As String = process.Name.ToLowerInvariant()
 
Dim processBaseName As String = System.IO.Path.GetFileName(processName)
 
If Not processBaseName = IISProcess Then
 
If Not processBaseName = "inetinfo.exe" Then
 
Continue For
 
End If
 
End If
 
'Determine if the process contains asp.dll
 
Dim aspLoaded As Boolean = False
 
Dim diagProcess As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessById(process.ProcessID)
 
Dim diagModule As System.Diagnostics.ProcessModule
 
For Each diagModule In diagProcess.Modules
 
Dim moduleName As String = System.IO.Path.GetFileName(diagModule.FileName).ToLowerInvariant()
 
If moduleName = "asp.dll" Then
 
aspLoaded = True
 
Exit For
 
End If
 
Next
 
'If the process contains asp.dll, attach to it
 
If aspLoaded Then
 
process.Attach2("Script")
 
processFound = True
 
End If
 
Next
 
If Not processFound Then
 
MsgBox("Could not find this IIS process. Hit a web page containing classic ASP script so that the process will start.")
 
End If
 
Catch ex As System.Exception
 
MsgBox(ex.Message)
 
End Try
 
End Sub

Cheers and Happy Coding :)