Proxy settings in UIWebview or at application level

2012-04-26 Thread Vikas Mahajan
Hi,

I am currently working on making an iOS browser which will have
provision to set proxy in it. I am making browser as wrapper around
UIWebview. But as NSURL / NSREQUEST doesn't support setting proxy, so
I got struck here. I know that we can set proxy in CFURL, so is there
any way we can capture packets send by UIWebview at CFNetwork level
inside our application to route them through proxy server?
Or does Cocoa supports reflection to set proxy dynamically inside
application sandbox?
Any other way by which we can set proxy in UIWebview or at application level?
Please help.


-- 
Thanks,

Vikas Mahajan
P.S.: I don't want to use ASIHTTPRequest because it has a lot of
limitations, so please suggest some different method.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Simple question - Subclassing NSView

2008-06-12 Thread Vikas
Hi,
   
  I have recently started programming on Mac using Objective-C and Cocoa. I am 
coming from C++/C# world. So, its a fairly basic question. Please help me 
understand the following code:
   
  @implementation MyView /*MyView inherits from NSView */
  -(void)drawRect: (NSRect)aRect {
  [[NSColor blackColor] set];
  NSRectFill( [self bounds] );
  }
   
  In first line, I was expecting something like [self setColor:[NSColor 
blackColor]];   (similar to this.color = NSColor.blackColor; in C#/C++)
  how NSColor object knows about where to set the color?
   
  In second line, NSRectFill(), I was expecting it to be called using square 
bracket [] notation. Again how this function knows where to fill the rectangle? 
There is no reference of NSView passed into the function?
   
  Lastly what are the rules of using () verses []?
   
  Thanks in advance for your time!
  -Vks

   
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Simple question - Subclassing NSView

2008-06-12 Thread Vikas
O'kay, that was helpful. 
  I still have one doubt. The declaration of NSRectFill is as below:
  void NSRectFill (
   NSRect aRect
);
   
  NSRectFill() is a C function, not part of any class e.g. NSView. aRect is 
simply a struct which specify location points (doesnt contain reference of any 
window). How the function knows about the drawing surface, in which 
window/surface to paint? Does it implicitly make use of some self pointer? If 
so, then, what if this function is not called from inside a simple C function 
then there will not be any self pointer?
   
  Thank You,
  -Vks
  

Hamish Allan [EMAIL PROTECTED] wrote:
  Hi Vikas,

On Thu, Jun 12, 2008 at 6:26 PM, Vikas wrote:

 I have recently started programming on Mac using Objective-C and Cocoa. I am 
 coming from C++/C# world. So, its a fairly basic question. Please help me 
 understand the following code:

 @implementation MyView /*MyView inherits from NSView */
 -(void)drawRect: (NSRect)aRect {
 [[NSColor blackColor] set];
 NSRectFill( [self bounds] );
 }

 In first line, I was expecting something like [self setColor:[NSColor 
 blackColor]]; (similar to this.color = NSColor.blackColor; in C#/C++)
 how NSColor object knows about where to set the color?

It's not setting the color of the NSView, it's setting the color of
the pen used by subsequent drawing operations such as NSRectFill().

 In second line, NSRectFill(), I was expecting it to be called using square 
 bracket [] notation. Again how this function knows where to fill the 
 rectangle? There is no reference of NSView passed into the function?

The NSView reference is self, as the code is implementing a method
of an NSView subclass. NSRectFill is a C function, not an Objective-C
method; you can mix C and Objective-C freely in a .m file.

 Lastly what are the rules of using () verses []?

If you want to call a plain C function, use the function name plus
parentheses just as you would in a plain C program. If you want to
call a method on an object, use the square bracket notation [objName
methodSelector].

Hamish


   
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]