Search Results

Search found 2441 results on 98 pages for 'delegate'.

Page 64/98 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Iterate attributes and IBOutlets of a UIViewController

    - by Espuz
    I've a generic UIViewController on my app. All the UIViewController on the app inherits from this generic one. I'm trying to automate the deallocation and releasing of attributes and IBOutlets as properties. I'm doing the first (attributes) on dealloc method and the second (IBOutlets as properties) on viewDidUnload. - (void) dealloc { [_att1 release]; _att1 = nil; [_att2 release]; _att2 = nil; // ... } - (void) viewDidUnload { self.att1 = nil; // att1 is an IBOutlet self.att2 = nil; // att2 is an IBOutlet // ... } Is there any way to iterate all my attributes and IBOutlets to simplify this operations? I want to avoid do it for each outlet and attribute and delegate it to the generic UIViewController. Thanks.

    Read the article

  • multiple regionDidChangeAnimated calls - what gives?

    - by mvexel
    I have a MKMapView inside a UITableView as a custom cell (don't ask ;) - don't know if it matters really), for which I register a regionDidChangeAnimated delegate method. This method gets called three times when the UITableView is loaded - once with the actual region and then two more times with a region that is way off. In the simulator, I consistently get a region with center (+37.43997405, -97.03125000). On the device, it seems to depend on the location reported by the location manager, which initializes the map view. Why am I getting three regionDidChangeAnimated calls? And why are the center coordinates for the last two of them off? This is the code I use to get the center coordinates: - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { CLLocation *l = [[CLLocation alloc] initWithLatitude:self.mapView.centerCoordinate.latitude longitude:self.mapView.centerCoordinate.longitude]; (....)

    Read the article

  • Java vs C# - AddActionListener vs event subscription

    - by S.O.
    Very simple question from one somewhat new to Java: when adding an event handler (or whatever it is called in Java) to a Control, MUST it be an object? I mean, in C# I can do control.event += System.eventHandler(methodThatHandlesEvent) Sure, that's because we have delegate types in C#, but I was wondering if I can choose which method would be called when an event is raised in Java? I mean, in Java I can have something like control.AddActionListener(objectWhichClassImplementsActionListener) And then I have the stupid actionPerformed method in this class, which is the only method that is called. I know, there are more kinds of listeners, but I can't have a "ActionListenerHandler" class in which I implement several actionPerformed methods that can be assigned to different controls?

    Read the article

  • Starting Game dev on iPhone:iPad - learning path ??

    - by Tibi
    Hi there, I'm beginning in iPhone/iPad game dev and I'm searching to set up my learning path. The basic features I would like to learn (after the basic SDK iphone components programming) are : using a board like interface where I can move pawn with my fingers detect where the pawn was moved and triggers events in the game The board will be constitute by 6 tiles that may be organised randomly when starting the game : may i use an sdk component with a delegate and datasource to determine where the pawn was left and on which tile ? need to use dices (which kind of library may I use ?) ... Do you have any idea about where to start ? ;-) Many thanks, Tib.

    Read the article

  • [iOS] How to catch cancallation of UIScrollView or others?

    - by kyu
    Sometimes, interruptions such as phone call occur and disturb a regular behavior of an app in iPhone or iPad. For example, I created one UIScrollView instance and implemented UIScrollView delegate methods: scrollViewWillBeginDragging and scrollViewDidEndDragging(and scrollViewDidEndDecelerating). A scrollViewWillBeginDragging method deactivated all custom buttons in my app. Then scrollViewDidEndDragging and scrollViewDidEndDecelerating methods activated these custom buttons. That is, while the user scrolled, all custom buttons became deactivated for a while. The problem was that while the user started to drag and just held an UIScrollView instance, if I took a screenshot by pressing a home button and a power button, then any of scrollViewDidEndDragging and scrollViewDidEndDecelerating didn't get called. So the app became messed up. I implemented a UIApplicationWillResignActiveNotification method in my UIViewController, but it didn't get called after taking a screenshot. How can I catch any kind of interruption that disturbs a regular flow of events? Sometimes, touchesEnd and touchesCanceled didn't get called too due to an interruption. Thank you.

    Read the article

  • How to load modules in Java

    - by gerardorn
    I'm building a server that loads modules. Each module is a .jar file. Inside the jar there's all the classes that the module needs. The server needs to read the jar, find the main class (it doesnt have the main method on it is just the class that makes the module work but not as a different program), build an object of that class and store it in a vector of modules so that it can acces to a specific module depending on the job to be done. How can I do that? As far as the server, it is listening and receiving request, but there's no modules to delegate the job to, since my vector of modules is empty.

    Read the article

  • How do you deal with the more mundane parts of programming tasks?

    - by Uri
    My experience as a developer is that many projects or tickets are a mix of a short and focused very interesting task (e.g., designing some API or a platform to solve something) and a lot of repetitive and mundane tasks that cannot be automated (such as certain refactorings to use the API or platform, implementation of certain tests, some GUI handling, etc). I believe that this is the nature of our profession, unless we are high-level architects or managements and can delegate this work. The only item in my personal arsenal when dealing with these tasks is to devote some of my attention to radio or audiobooks (preferably not in English as I find it hard to concentrate on two "streams" of English at the same time). I maintain sufficient attention to carry the task and don't lose concentration as fast. I'm wondering how others cope with these and maintain concentration.

    Read the article

  • didSelectRowAtIndexPath being called after viewDidLoad of the called view

    - by Serguei Fedorov
    I am trying to pass variables over to the new view. I have the following code: appDelegate *dataCenter = (AppDelegate*)[[UIApplication sharedApplication] delegate]; dataCenter.myVariable = [array objectAtIndex:indexPath.row]; in the didSelectRowAtIndexPath of the calling view. However, the issue that I have is that this variable is empty in the vewDidLoad function of the next view, simply because it fired off BEFORE the didSelectRowAtIndexPath of the calling view. I am using storyboard to link the views together. Both are UITableView. If I hit back and then reselect the table element it is then set, granted that by the time I hit back and then selected again, the variable got set. Is there any way to for the order of execution? I really don't want to do UI view switching on the back end. Any help is greatly appreciated!

    Read the article

  • Load all tab bar views when application first runs

    - by codenoobie
    Here's the problem. I have a tab bar controller with 4 separate views. When I navigate from the first view to the second view, it takes some time to load up the second view. What I want to do is be able to load and initialize all of my tab bar views during my splash screen. That way, when the user navigates between the tab views, there is no wait time. So the question is... how do I manually initialize my individual tab bar views in my app delegate? And once again, thank you stackoverflow!

    Read the article

  • How to notify ViewController on parse end with multiple ViewControllers using a single parser.

    - by objneodude
    Hello, I have created a RSS parser and 3 TableViews and it parses the RSS files fine but I don't know how to notify the TableViewController when parsing has ended so it can update the view. The TableViewController initiates the parser and the parsing of a feed. parser = [[RSSParser alloc] initWithURL:@"http://randomfeed.com"]; I can access the single feed items like [parser feedItems]; In parser.m i have implemented the delegate methods of NSXMLParser: - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName - (void)parserDidEndDocument:(NSXMLParser *)parser So how do i get parserDidEndDocument to notify my controllers so i can add the data to the tableview. Cheers from a obj-c beginner.

    Read the article

  • When is NSEnumerator finished?

    - by samfu_1
    How do we know when enumeration is finished? The docs say: the return value of nextObject is nil when all objects have been enumerated. I was hoping to implement some "delegate-like" behavior whereby ... if (nextObject == nil) { do something because we're done! } But I see there is no such thing as: enumerationDidFinish: where in the following block could I check for the enumerator to be complete? NSArray *anArray = // ... ; NSEnumerator *enumerator = [anArray objectEnumerator]; id object; while ((object = [enumerator nextObject])) { // do something with object... }

    Read the article

  • C# wrapper of c++ dll; "Run-Time Check Failure #0 - The value of ESP was not properly saved across a

    - by Deveti Putnik
    Here is the code in C++ dll: extern "C" _declspec(dllexport) int testDelegate(int (*addFunction)(int, int), int a, int b) { int res = addFunction(a, b); return res; } and here is the code in C#: public delegate int AddIntegersDelegate(int number1, int number2); public static int AddIntegers(int a, int b) { return a + b; } [DllImport("tester.dll", SetLastError = true)] public static extern int testDelegate(AddIntegersDelegate callBackProc, int a, int b); public static void Main(string[] args) { int result = testDelegate(AddIntegers, 4, 5); Console.WriteLine("Code returned:" + result.ToString()); } When I start this small app, I get the message from the header of this post. Can someone help, please? Thanks in advance, D

    Read the article

  • NSTableView doesn't populate with array objects until a new object is added via the controller

    - by Luke
    I have an NSTableView and an array controller set up as shown here, using cocoa bindings: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TableView/PopulatingViewTablesWithBindings/PopulatingView-TablesWithBindings.html#//apple_ref/doc/uid/10000026i-CH13-SW3 In my app delegate during applicationDidFinishLaunching I have the following snippet in here, initialising the array and filling it with objects array = [[NSMutableArray alloc] init]; SomeObject* foo = [[Object alloc] init]; foo.text = @"sup"; [array addObject:foo]; //Repeat this a few times However, when I build the app and run it I end up with an empty table. However, if I bind a button to the array controller's add: input and click it during runtime (this adds a new object to the array and table) then the table will show the new object first, with the objects added during applicationDidFinishLaunching following it. Why does this happen? And is there a way to make my table populate without having to add an element first?

    Read the article

  • Pass an event into a constructor

    - by Vaccano
    I have a class that I want to be able the handle the mouse up event for a grid. I tried to create it with a static method call like this: MyDataBinding.BindObjectsToDataGrid(ListOfObjectsToBind, myGrid.MouseUp); The end goal being that in the method I would assign a delegate to the MouseUp PassedInMouseUp += myMethodThatWillHandleTheMouseUp; Looks good here (to me) but the compiler chokes on the first line. It says that I can only use MouseUp with a += or a -=. Clearly I am going about this the wrong way. How can I get a different class to handle the mouse up with out having to: Pass in the whole grid Expose the method that will be handling the mouse up as a public method. Or, is this just a limitation and I will have to do one of the above?

    Read the article

  • Assigning data to an <li> element?

    - by user246114
    Hi, I am generating some list items as a result of a search, and I want to attach some data to each list element from the search (possibly a bad idea to merge ui and data), but now curious about it. I am doing this: var element = $("<li>Hello</li>); element.mydata = "foo"; element.appendTo("#panelParent"); so I'm just assigning my stuff to element.mydata. My click handler reports that no such data exists for the element when clicked: $('#panelParent').delegate('li', 'click', function() { // this.mydata is undefined. }); where did it go to? I could keep the data external to the a list item element, was wondering if there's a convenient way like this to just keep it bound though? Thanks

    Read the article

  • Where to register for C# events?

    - by themaninthesuitcase
    I am currently transitioning from VB to C# and am having some issues with regards to registering my interest in an event. When using VB it was simply a case of specifying that a method Handles and event, often this was generated by using the object events list. While I can easily use the Class.event += delegate in C# I am unsure where the best place is to place the code to do this. Am I best placing it inside of the InitializeComponent() as per the generated code (say if you select the event in the from designer) or should I place it inside the constructor for better readability/maintenance. If inside the constructor, should it be before or after the call to InitializeComponent()?

    Read the article

  • C# compile error for simple Annual Salary Calculator

    - by Mike Vignapiano
    I am new to C# and trying to create my 1st app. I have 3 errors. The first two say that txtSalary and Salary do not exist. The 3rd says that it cannot convert method group 'ToString' to non-delegate type 'string'. and asks if I intend to invoke the method. Here is what I have: protected void Button1_Click(object sender, EventArgs e) { int salary, AnnualHours, Rate; string txtAnnualHours, txtSalary, txtRate; salary = AnnualHours * Rate; txtsalary = int.Parse(Salary); txtAnnualHours = salary.ToString; MessageBox.Show(salary); } According to my book, when you enter numerics in AnnualHours and Rate textbox, when click Button1, these values are converted from string to integers, then multiplied for salary. Then numeric answer converted to string and displayed in messagebox named txtSalary. Please show me what I got wrong because according to the book, I am not missing anything.

    Read the article

  • Help me to complete my UITableView to Navigation Controller [iPhone SDK]

    - by Momeks
    I built an application. On the one my views I used TableView. So now I want to change this Table view to a navigation controller. 1- How can I change UITable view to Navigation Controller. I add navigation codes but I got some alert! [I know I must identify my navigation delegate, but HOW ?] Here is my Mapping Views! AppNameViewController FirstViewController [on this view I used table view and I want change to nav] SecondViewController ThirdViewControllerController

    Read the article

  • Java how to load modules

    - by gerardorn
    heres my problem: im building a server that loads modules. each module is a .jar file. inside the jar theres all the classes that the module need. the server needs to read the jar, find the main class (it doesnt have the main method on it is just the class that makes the module work but not as a different program), build an object of that class and store it in a vector of modules so that it can acces to a specific module depending on the job to be done. how can i do that? as far as the server, it is listening and reciving request, but thes no modules to delegate the job to, since my vector of modules is empty

    Read the article

  • Getting a SIGABRT error in dismissModalViewController

    - by mcalleja
    Im receiving a SIGABRT error when I cancel a MFMailComposeViewController, exactly in the dismissViewController, don't work I have a UIViewController within a UINavigationController. My Code: - (void)sendMail { if ([MFMailComposeViewController canSendMail]) { controller = [[MFMailComposeViewController alloc] init]; [[controller navigationBar] setTintColor:[UIColor getHexColorWithRGB:@"e2de09" alpha:1.0f]]; controller.mailComposeDelegate = self; [controller setSubject:@"Subject"]; NSString *msg="xxxxx"; [controller setMessageBody:msg isHTML:YES]; [self presentModalViewController:controller animated:YES]; } else { NSString * errorString = [NSString stringWithFormat:@"mail account not set."]; UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error:" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [errorAlert show]; } } The presentModalViewController:animated: works correctly. - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self becomeFirstResponder]; [self dismissModalViewControllerAnimated:YES]; } But calling [self dissmissModalViewControllerAnimatedLYES] causes a SIGABRT error.

    Read the article

  • Capture Video in iPhone

    - by Timmi
    Hi, I used the following code to record video. UIImagePickerController *m_objpicker;=[[UIImagePickerController alloc] init]; m_objpicker.sourceType = UIImagePickerControllerSourceTypeCamera; m_objpicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]; // hide the camera controls //picker.showsCameraControls=NO; m_objpicker.delegate = self; //picker.allowsImageEditing = NO; m_objpicker.allowsEditing=NO; // and put our overlay view in //picker.cameraOverlayView=m_objOverlayView; [self presentModalViewController:m_objpicker animated:YES]; When we finish recording (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ NSURL *m_objMediaURL=[info objectForKey:UIImagePickerControllerMediaURL]; [m_objpicker dismissModalViewControllerAnimated:YES]; } My doubt is, how to save the captured video to a location we specify. Also how to use UISaveVideoAtPathToSavedPhotosAlbum . What all things i need to change in my code so that i can save video to a specified location Thanks,

    Read the article

  • Is there a way to get the current UIEvent being handled?

    - by not-
    I'm working in a class that is a delegate of another class; this other class is in a third-party library that I'd like to avoid changing if at all possible. The original class is handling a -touchesEnded event, and is delegating responsibility to me, but it doesn't pass the UIEvent itself to me. Is there a way to get a handle to the current event in progress? It's a double-tap handler, and all that is passed to me is the view being touched, and the point at which the touch occurred. I want to know exactly how many touches are involved in the event. Thanks! randy

    Read the article

  • Getting the size of an opening window in WebKit

    - by ThereSkippy
    Hi, I'm implementing a "WebKit Browser In An Application" which basically embeds WebViews in Qt widgets (we're using the WebKit browser instead of Qt's since it's stabler and more up-to-date). So far everything's great, until someone clicks on a link which invokes a Javascript "Window.open" function with a custom width and height for the new window. I've set the various delegates for the parent window: setFrameLoadDelegate, setResourceLoadDelegate, setPolicyDelegate, and setUIDelegate. I am getting a createWebViewWithRequest in the UI delegate as expected when the window opens (with a null request, as others have noted). I then get a decidePolicyForNavigationAction for the new window, but it doesn't have the proposed window's width or height. I NEVER get a decidePolicyForNewWindowAction for JavaScript window.open (also noted by others). So I'm at a loss. Is there a way to get this information so I can set the Qt Widget's size correctly?

    Read the article

  • UITableView headings shown on top of MBProgressHUD

    - by Chris Ballinger
    So I have a subclass of UITableViewController that loads some data from the internet and uses MBProgressHUD during the loading process. I use the standard MBProgressHUD initialization. HUD = [[MBProgressHUD alloc] initWithView:self.view]; [self.view addSubview:HUD]; HUD.delegate = self; HUD.labelText = @"Loading"; [HUD show:YES]; This is the result: . Is there any way to resolve this issue, or should I just abandon MBProgressHUD? Thanks!

    Read the article

  • UITableViewController executes delate functions before network request finishes

    - by user1543132
    I'm having trouble trying to populate a UITableView with the results of a network request. It seems that my code is alright as it works perfectly when my network is speedy, however, when it's not, the function - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath- still executes, which results in a bad access error. I presume that this is because the array that the aforesaid function attempts to utilize has not been populated. This brings me to my question: Is there anyway that I can have the UITableView delegate methods delayed to avoid this? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"AlbumsCell"; //UITableViewCell *basicCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; AlbumsCell *cell = (AlbumsCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (!cell) { **// Here is where the Thread 1: EXC_BAD_ACCESS (code=2 address=0x8)** cell = [[[AlbumsCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } Album *album = [_albums objectAtIndex:[indexPath row]]; [cell setAlbum:album]; return cell; }

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >