Search Results

Search found 1343 results on 54 pages for 'thomas ng'.

Page 8/54 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Generating a field setter and getter with ASM

    - by ng
    I would like to avoid reflection in an open source project I am developing. Here I have classes like the following. public class PurchaseOrder { @Property private Customer customer; @Property private String name; } I scan for the @Property annotation to determine what I can set and get from the PurchaseOrder reflectively. There are many such classes all using java.lang.reflect.Field.get() and java.lang.reflect.Field.set(). Ideally I would like to generate for each property an invoker like the following. public interface PropertyAccessor<S, V> { public void set(S source, V value); public V get(S source); } Now when I scan the class I can create a static inner class of PurchaseOrder like so. static class customer_Field implements PropertyAccessor<PurchaseOrder, Customer> { public void set(PurchaseOrder order, Customer customer) { order.customer = customer; } public Customer get(PurchaseOrder order) { return order.customer; } } With these I totally avoid the cost of reflection. I can now set and get from my instances with native performance. Can anyone tell me how I would do this. A code example would be great. I have searched the net for a good example but can find nothing like this. The ASM examples are pretty poor also. The key here is that I have an interface that I can pass around. So I can have various implementations, perhaps one with Java Reflection as a default, one with ASM, and maybe one with Javassist? Any help would be greatly appreciated.

    Read the article

  • To use the 'I' prefix for interfaces or not to

    - by ng
    That is the question? So how big a sin is it not to use this convention when developing a c# project? This convention is widely used in the .NET class library. However, I am not a fan to say the least, not just for asthetic reasons but I don't think it makes any contribution. For example is IPSec an interface of PSec? Is IIOPConnection An interface of IOPConnection, I usually go to the definition to find out anyway. So would not using this convention cause confusion? Are there any c# projects or libraries of note that drop this convention? Do any c# projects that mix conventions, as unfortunately Apache Wicket does? The Java class libraries have existed without this for many years, I don't feel I have ever struggled to read code without it. Also, should the interface not be the most primitive description? I mean IList<T> as an interface for List<T> in c#, is it not better to have List<T> and LinkedList<T> or ArrayList<T> or even CopyOnWriteArrayList<T>? The classes describe the implementation? I think I get more information here, than I do from List<T> in c#.

    Read the article

  • Parameter attributes in c#

    - by ng
    How can I do the following with c# attributes. Below is a snippet of Java that annotates parameters in a constructor. public class Factory { private final String name; private final String value; public Factory(@Inject("name") String name, @Inject("value") String value) { this.name = name; this.value = value; } } From looking at c# annotations it does not look like I can annotate parameters. Is this possible?

    Read the article

  • Combine Related Resources With TastyPie

    - by Aaron Ng
    How can I combine multiple Resources in TastyPie? I have 3 models I'd like to combine: users, profiles and posts. Ideally I'd like profiles nested within user. I'm not sure where to go from here. class UserResource(ModelResource): class Meta: queryset = User.objects.all() resource_name = 'user' fields = ['username','id','date_joined'] #Improper Auth authorization = Authorization() class UserProfileResource(ModelResource): class Meta: queryset = UserProfile.objects.all() resource_name = 'profile' class UserPostResource(ModelResource): user = fields.ForeignKey(UserResource,'user', full=True) class Meta: queryset = UserPost.objects.all() resource_name = 'userpost' #Improper Auth authorization = Authorization()

    Read the article

  • Dynamically add annotation to an existing class

    - by ng
    I have the following class public class Person { ... } I would like to create another class that would look like this. @SomeAnnotation public class Person { ... } Via a simple method like so. public static Class addAnnotation(Class originalType, Class<? extends Annotation> annotation) { // what goes here? } Is there an easy way to do this via ASM for example? What dependencies would I need. I have tried to Google this however the examples I have found are either incomplete or are doing something else. Other frameworks such as javassist would be just as good.

    Read the article

  • Clear button at uisearchbar not working at all

    - by kevin.ng
    I created a search bar programmatically and added to my view using the codes below: - (void)viewDidLoad { searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(xPositionForSearchBar, yPositionForSearchBar, widthForSearchBar, heightForSearchBar)]; UIView *bg = [[searchBar subviews] objectAtIndex:0]; searchBar.delegate = self; searchBar.placeholder = @"Search record"; for(UIView *view in searchBar.subviews){ if([view isKindOfClass:[UITextField class]]){ UITextField *tf = (UITextField *)view; tf.delegate = self; break; } } [bg removeFromSuperview]; [self.view addSubview: searchBar]; } The code is implemented with UISearchBarDelegate and UITextFieldDelegate. I have tried using - (void)searchBarCancelButtonClicked:(UISearchBar *)aSearchBar { NSLog(@"cancel clicked"); searchBar.text = @""; [aSearchBar resignFirstResponder]; } - (BOOL)textFieldShouldClear:(UITextField *)textField { NSLog(@"clear"); [self performSelector:@selector(searchBarCancelButtonClicked:) withObject:searchBar afterDelay: 0.1]; return YES; } and yet, the text inside the searchBar is not cleared at all when i click on the "clear button" - a circle with a "X" inside. The clear button works when I implemented it in IB. Wonder why? Kindly advice, many thanks.

    Read the article

  • Inferring type from method generics

    - by ng
    I am from a Java background and I am looking from the equivalent in c# for the following. public interface Reader { <T> T read(Class<? extends T> type); } Such that I can do the following, constraining the parameter and inferring the return type. Cat cat = reader.read(Cat.class); Dog dog = reader.read(Dog.class); I was hoping something like this would work in c# but I am not sure it will. public interface Reader { T Read<T>(); } And and do this. public class TypeReader : Reader { public T Read<T>() { Type type = T.GetType(); ... } } Is something like this even possible in c#?

    Read the article

  • Extending abstract classes in c#

    - by ng
    I am a Java developer and I have noticed some differences in extending abstract classes in c# as opposed to Java. I was wondering how a c# developer would achived the following. 1) Covarience public abstract class A { public abstract List<B> List(); } public class BList : List<T> where T : B { } public abstract class C : A { public abstract BList List(); } So in the above hierarchy, there is covarience in C where it returns a type compatible with what A returns. However this gives me an error in Visual Studio. Is there a way to specify a covarient return type in c#? 2) Adding a setter to a property public abstract class A { public abstract String Name { get; } } public abstract class B : A { public abstract String Name { get; set } } Here the compiler complains of hiding. Any suggestions? Please do not suggest using interfaces unless that is the ONLY way to do this.

    Read the article

  • Socket c# not listen on port over internet?

    - by Nguy?n Van Th?ng
    Code server I have server listen on port 1450: //Using UDP sockets clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); EndPoint ourEP = new IPEndPoint(IPAddress.Any, 1450); //Listen asynchronously on port 1450 for coming messages (Invite, Bye, etc). clientSocket.Bind(ourEP); //Receive data from any IP. EndPoint remoteEP = (EndPoint)(new IPEndPoint(IPAddress.Any, 0)); byteData = new byte[1024]; //Receive data asynchornously. clientSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref remoteEP, new AsyncCallback(OnReceive), null); but code on not open port 1450 and client connect: otherPartyIP = new IPEndPoint(IPAddress.Parse(txtCallToIP.Text), 1450); otherPartyEP = (EndPoint)otherPartyIP; When i run code client and server in lan network it's ok. but run over network i check port 1450 in lan not open. tell me how open port 1450 in code server? thanks

    Read the article

  • TXT File or Database?

    - by Ruth Rettigo
    Hey folks! What should I use in this case (Apache + PHP)? Database or just a TXT file? My priority #1 is speed. Operations Adding new items Reading items Max. 1 000 records Thank you. Database (MySQL) +----------+-----+ | Name | Age | +----------+-----+ | Joshua | 32 | | Thomas | 21 | | James | 34 | | Daniel | 12 | +----------+-----+ TXT file Joshua 32 Thomas 21 James 34 Daniel 12

    Read the article

  • Filtering a dropdown in Angular IE11 issue

    - by Brian S.
    I have a requirement for a select html element that can be duplicated multiple times on a page. The options for these select elements all come from a master list. All of the select elements can only show all of the items in the master list that have not been selected in any of the other select elements unless they just were duplicated. So I wrote a custom filter to do this in Angular and it seems to work just fine provided you are not using IE11. In IE when you select a new item from a duplicated select element, it seems to select the option after the one you selected even though the model still has the correct one set. I realize this sounds convoluted, so I created a jFiddle example. Using IE 11 try these steps: Select Bender Click the duplicate link Select Fry Notice that the one that is selected is Leela but the model still has Fry (id:2) as the one selected Now if you do the same thing in Chrome everything works as expected. Can anyone tell me how I might get around this or what I might be doing wrong? Here is the relevant Angular code: myapp.controller('Ctrl', function ($scope) { $scope.selectedIds = [{}]; $scope.allIds = [{ name: 'Bender', value: 1}, {name: 'Fry', value: 2}, {name: 'Leela', value: 3 }]; $scope.dupDropDown = function(currentDD) { var newDD = angular.copy(currentDD); $scope.selectedIds.push(newDD); } }); angular.module('appFilters',[]).filter('ddlFilter', function () { return function (allIds, currentItem, selectedIds) { //console.log(currentItem); var listToReturn = allIds.filter(function (anIdFromMasterList) { if (currentItem.id == anIdFromMasterList.value) return true; var areThereAny = selectedIds.some(function (aSelectedId) { return aSelectedId.id == anIdFromMasterList.value; }); return !areThereAny; }); return listToReturn; } }); And here is the relevant HTML <div ng-repeat="aSelection in selectedIds "> <a href="#" ng-click="dupDropDown(aSelection)">Duplicate</a> <select ng-model="aSelection.id" ng-options="a.value as a.name for a in allIds | ddlFilter:aSelection:selectedIds"> <option value="">--Select--</option> </select> </div>

    Read the article

  • Exclude a string from wildcard search in a shell

    - by steigers
    Hello everybody I am trying to exclude a certain string from a file search. Suppose I have a list of files: file_Michael.txt, file_Thomas.txt, file_Anne.txt. I want to be able and write something like ls *<and not Thomas>.txt to give me file_Michael.txt and file_Anne.txt, but not file_Thomas.txt. The reverse is easy: ls *Thomas.txt Doing it with a single character is also easy: ls *[^s].txt But how to do it with a string? Sebastian

    Read the article

  • Cracking WEP wireless networks [closed]

    - by John
    I have a problem.I am new to linux and would like to know how to crack a WEP and WAP wireless encrypted network.I have been typing the command "airmon-ng" i have even initialized the wlan0 with the following command on Backtrack 4 but it has failed,When I use airmon-ng command, it does not display my wireless driver.SomeOne please xplain to me from scratch.Would really appreciate it.

    Read the article

  • angular-ui-router : breadcrumps ok but view ko

    - by anakin59490
    this is my app.router.js : agentRouter.config([ '$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { var root = { name: 'root', abstract: true, url: '', title: 'home', views: { 'header': { templateUrl: 'views/headers/header.app.html', controller: 'HeaderCtrl' }, 'body': { templateUrl: "views/root.html" }, 'footer': { templateUrl: 'views/footers/footer.app.html' } } }; var agent = { name: 'root.agent', url: '/agent', title: 'agent', views: { 'root.sidebar': { templateUrl: "views/main.sidebar.html" }, 'root.container': { templateUrl: "views/partials/agent/list.container.html" } } }; var detail = { name: 'root.agent.detail', url: '/detail/:id', title: 'agentDetail', // use for breadcrumb views: { 'root.sidebar': { templateUrl: "views/main.sidebar.html" }, 'root.container': { templateUrl: "views/partials/agent/list.chantier.html" } } }; /.../ $stateProvider.state(root); $stateProvider.state(agent); $stateProvider.state(detail); } ]); and this is my root.html : <!--Breadcrumb content--> <ul class="row breadcrumb"> <i class="glyphicon glyphicon-home" style=""></i> <li ng-repeat="state in $state.$current.path"> <a ng-href="#{{state.url.format($stateParams)}}"><span ng-bind="state.title"></span></a> <span ng-hide="$last" class=""></span> </li> </ul> <!--Sidebar content--> <div ui-view="root.sidebar">default root.sidebar</div> <!--Container content--> <div style="background-color: #f9f9f9" ui-view="root.container">default root.container</div> I can access to my "agent" page (a list of person) and my breadcrumb is right : home / agent but when i click on an item of the list i got always the same page but my breadcrumb is right : home / agent / agentDetail but in app.router.js if change detail like this : var detail = { name: 'root.detail', // référence initiale + detail (fils) url: '/agent/detail/:id', // réference utilisée dans les fichiers HTML, attention c'est la suite de l'url précédente!!! title: 'agentDetail', // référence utilisée pour le breadcump views: { 'root.sidebar': { templateUrl: "views/main.sidebar.html" }, 'root.container': { templateUrl: "views/partials/agent/list.chantier.html" } } }; i got the right page (list.chantier.xml) but the breadcrumb is false : home / agentDetail instead of home / agent / agentDetail I would like to got the right breadcrumb (home / agent / agentDetail) with the right page (list.chantier.html) when i click on an item of the agent list page (list.container.html) Thank you in advance for your help

    Read the article

  • How to specify java script files required by an angular app

    - by Vishal Kaushik
    I'm looking for a way to specify required js files by an angular app. So that, we don't need to include an array of tag for all the files which may be required by some ng-app. The main idea behind this requirement is - we might not need to load all the resources on the browser at once. Which ever ng-app gets loaded onto the screen, will fetch its dependencies on its own from the server. Is there any existing way within angularJS to achieve this goal..?

    Read the article

  • jqGrid Coloring an entire line in Grid based upon a cells value

    - by Thomas
    Hi all, i know it's been asked before but i cant get it to run and i'm out of things to try. So i want to colorize a row in a Grid if its value is not 1 - i use a custom formatter for this. The formatter itself works, thats not the problem. I've tried multple ways I've found so far on the web - adding a class, directly adding css code, using setRowData, using setCell.... Here are my examples - none of them worked for me (linux, ff363) - any pointer would be gratly appreciated. 27.05.2010_00:00:00-27.05.2010_00:00:00 is my row id <style> .state_inactive { background-color: red !important; } .state_active { background-color: green !important; } </style> function format_state (cellvalue, options, rowObject) { var elem='#'+options.gid; if (cellvalue != 1) { jQuery('#list2').setRowData(options.rowID,'', {'background-color':'#FF6F6F'}); jQuery('#list2').setRowData('27.05.2010_00:00:00-27.05.2010_00:00:00', '',{'background-color':'#FF6F6F'}); for (var cnt=0;cnt<rowObject.length;cnt=cnt+1) { jQuery(elem).setCell(options.rowId,cnt,'','state_inactive',''); jQuery(elem).setCell('"'+options.rowId+'"',cnt,'','state_inactive'); jQuery(elem).setCell('"'+options.rowId+'"',cnt,'5', {'background-color':'#FF6F6F'},''); } } else { for (var cnt=0;cnt<rowObject.length;cnt=cnt+1) { jQuery(elem).setCell(options.rowId,cnt,'','state_active',''); } } <!-- dont modify, we simply added the class above--> return cellvalue; } Thanks, Thomas

    Read the article

  • Qt Object Linker Problem " undefined reverence to vtable"

    - by Thomas
    This is my header: #ifndef BARELYSOCKET_H #define BARELYSOCKET_H #include <QObject> //! The First Draw of the BarelySocket! class BarelySocket: public QObject { Q_OBJECT public: BarelySocket(); public slots: void sendMessage(Message aMessage); signals: void reciveMessage(Message aMessage); private: // QVector<Message> reciveMessages; }; #endif // BARELYSOCKET_H This is my class: #include <QTGui> #include <QObject> #include "type.h" #include "client.h" #include "server.h" #include "barelysocket.h" BarelySocket::BarelySocket() { //this->reciveMessages.clear(); qDebug("BarelySocket::BarelySocket()"); } void BarelySocket::sendMessage(Message aMessage) { } void BarelySocket::reciveMessage(Message aMessage) { } I get the Linker Problem : undefined reference to 'vtable for barelySocket' This should mean, i have a virtual Function not implemented. But as you can see, there is non. I comment the vector cause that should solve the Problem, but i does not. The Message is a complex struct, but even converting it to int did not solve it. I searched Mr G but he could not help me. Thank you for your support, Thomas

    Read the article

  • Displaying indexed png- files out of NSArray on the iphone screen

    - by Thomas Hülsmann
    Hi, i like to create an artwork counter- display on an iphone, diplaying 0 to 9. The 10 digits are 10 png- files with the numbers 0 to 9 as their artwork content. The 10 png- files are implemented by using NSArray. Following you'll find the implementation- code: zahlenArray = [NSArray arrayWithObjects: [UIImage imageNamed:@"ziffer-0.png"], [UIImage imageNamed:@"ziffer-1.png"], [UIImage imageNamed:@"ziffer-2.png"], [UIImage imageNamed:@"ziffer-3.png"], [UIImage imageNamed:@"ziffer-4.png"], [UIImage imageNamed:@"ziffer-5.png"], [UIImage imageNamed:@"ziffer-6.png"], [UIImage imageNamed:@"ziffer-7.png"], [UIImage imageNamed:@"ziffer-8.png"], [UIImage imageNamed:@"ziffer-9.png"], nil]; As an index for the 10 digitis I use an integer variable, initializing with 0: int counter = 0; Furthermore I declare an UIImageview programmaticaly: UIImageView *zahlenEinsBisNeun; The implementation code for the UIImageview is: zahlenEinsBisNeun = [UIImage alloc] initWithFrame:CGRectMake(240, 50, 200, 200)]; ???????????????????????????????????????? [self.view addSubview:zahlenEinsBisNeun]; [zahlenEinsBisNeun release]; There, where you see the questionmarks, I don't know how to write the code, to retrieve my content artworks 0 to 9 from NSArray with the index "counter" and make it visible on my iphone screen by using .... addSubview:zahlenEinsBisNeun ... Can anybody help??? My thanks for your support in advance Thomas Hülsmann

    Read the article

  • How do I access variable values from one view controller in another?

    - by Thomas
    Hello all, I have an integer variable (time) in one view controller whose value I need in another view controller. Here's the code: MediaMeterViewController // TRP - On Touch Down event, start the timer -(IBAction) startTimer { time = 0; // TRP - Start a timer timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTimer) userInfo:nil repeats:YES]; [timer retain]; // TRP - Retain timer so it is not accidentally deallocated } // TRP - Method to update the timer display -(void)updateTimer { time++; // NSLog(@"Seconds: %i ", time); if (NUM_SECONDS == time) [timer invalidate]; } // TRP - On Touch Up Inside event, stop the timer, decide stress level, display results -(IBAction) btn_MediaMeterResults { [timer invalidate]; NSLog(@"Seconds: %i ", time); ResultsViewController *resultsView = [[ResultsViewController alloc] initWithNibName:@"ResultsViewController" bundle:nil]; [self.view addSubview:resultsView.view]; } And in ResultsViewController, I want to process time based on its value ResultsViewController - (void)viewDidLoad { if(time < 3) {// Do something} else if ((time > 3) && (time < 6)) {// Do something else} //etc... [super viewDidLoad]; } I'm kind of unclear on when @property and @synthesize is necessary. Is that the case in this situation? Any help would be greatly appreciated. Thanks! Thomas

    Read the article

  • SQL 2008: Using separate tables for each datatype to return single row

    - by Thomas C
    Hi all I thought I'd be flexible this time around and let the users decide what contact information the wish to store in their database. In theory it would look as a single row containing, for instance; name, adress, zipcode, Category X, Listitems A. Example FieldType table defining the datatypes available to a user: FieldTypeID, FieldTypeName, TableName 1,"Integer","tblContactInt" 2,"String50","tblContactStr50" ... A user the define his fields in the FieldDefinition table: FieldDefinitionID, FieldTypeID, FieldDefinitionName 11,2,"Name" 12,2,"Adress" 13,1,"Age" Finally we store the actual contact data in separate tables depending on its datatype. Master table, only contains the ContactID tblContact: ContactID 21 22 tblContactStr50: ContactStr50ID,ContactID,FieldDefinitionID,ContactStr50Value 31,21,11,"Person A" 32,21,12,"Adress of person A" 33,22,11,"Person B" tblContactInt: ContactIntID,ContactID,FieldDefinitionID,ContactIntValue 41,22,13,27 Question: Is it possible to return the content of these tables in two rows like this: ContactID,Name,Adress,Age 21,"Person A","Adress of person A",NULL 22,"Person B",NULL,27 I have looked into using the COALESCE and Temp tables, wondering if this is at all possible. Even if it is: maybe I'm only adding complexity whilst sacrificing performance for benefit in datastorage and user definition option. What do you think? Best Regards /Thomas C

    Read the article

  • How can I load a view based on how long I hold a UIButton?

    - by Thomas
    Hello all, I've searched the net and documentation, but haven't found anything quite like what I'm trying to do. I'm working on an app where I want to load one view if a UIButton is held for x seconds, another if it's held for x+y seconds, etc. I found this tutorial. The problem I'm running into is, how do I switch the length of the button press? The tutorial switched the number of taps. -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSSet *allTouches = [event allTouches]; switch ([allTouches count]) { case 1: // Single touch { // Get the first touch. UITouch *touch = [[allTouches allObjects] objectAtIndex:0]; switch ([touch tapCount]) { case 1: // Single Tap. { // Start a timer timer = [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(showAlertView:) userInfo:nil repeats:NO]; [timer retain]; } break; case 2: // Double tap. break; } } break; case 2: // Double touch { } break; default: break; } } Any suggestions? Thanks! Thomas

    Read the article

  • How to efficiently show many Images? (iPhone programming)

    - by Thomas
    In my application I needed something like a particle system so I did the following: While the application initializes I load a UIImage laserImage = [UIImage imageNamed:@"laser.png"]; UIImage *laserImage is declared in the Interface of my Controller. Now every time I need a new particle this code makes one: // add new Laserimage UIImageView *newLaser = [[UIImageView alloc] initWithImage:laserImage]; [newLaser setTag:[model.lasers count]-9]; [newLaser setBounds:CGRectMake(0, 0, 17, 1)]; [newLaser setOpaque:YES]; [self.view addSubview:newLaser]; [newLaser release]; Please notice that the images are only 17px * 1px small and model.lasers is a internal array to do all the calculating seperated from graphical output. So in my main drawing loop I set all the UIImageView's positions to the calculated positions in my model.lasers array: for (int i = 0; i < [model.lasers count]; i++) { [[self.view viewWithTag:i+10] setCenter:[[model.lasers objectAtIndex:i] pos]]; } I incremented the tags by 10 because the default is 0 and I don't want to move all the views with the default tag. So the animation looks fine with about 10 - 20 images but really gets slow when working with about 60 images. So my question is: Is there any way to optimize this without starting over in OpenGl ES? Thank you very much and sorry for my english! Greetings from Germany, Thomas

    Read the article

  • QT EventTransition implementation

    - by Thomas
    I am trying to build an QT State Maschine. I have some States, and for those States i need Transition that alter the Graphics on my gui. The Problem i having and the only reason i am asking, i am Stuck and Point 1. The compiler cant identifie the QTEventTransition. I have QT 4.6 wroking with QT Creator on Windows. The compiler does not find Header #include < QtEventTransition This is what i did i never did this bevor but i think it should be correct, I have A Header File where i have my Transitions Declareted like this: class validateBoatTransition : public QtEventTransition { public: validateBoatTransition(Widget *widget,ServerSkeleton* server); protected: bool eventTest(QEvent *e); void onTransition(QEvent *); private: Chart* ourChart; Message current; BarelySocket* myBarelySocket; }; Than i have my Cpp File where i have this: validateBoatTransition::validateBoatTransition(Widget *widget,ServerSkeleton* server) { } void validateBoatTransition::onTransition(QEvent *e) { /* My Logik should go here */ } What i want is that if the Transition is activated by an Button (clicked) it should fire this transition! I searched the net, but cant find an solution. Can i do that? I should i think. Yours Thomas

    Read the article

  • Why is my UIWebView not scrollable?

    - by Thomas
    In my most frustrating roadblock to date, I've come across a UIWebView that will NOT scroll! I call it via this IBAction: -(IBAction)session2ButtonPressed:(id)sender { Session2ViewController *session2View = [[Session2ViewController alloc]initWithNibName:@"Session2ViewController" bundle:nil]; self.addictionViewController = session2View; [self.view insertSubview:addictionViewController.view atIndex:[self.view.subviews count]]; [session2View release]; } In the viewDidLoad of Session2ViewController.m, I have - (void)viewDidLoad { [super viewDidLoad]; // TRP - Grab data from plist // TRP - Build file path to the plist NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Addiction" ofType:@"plist"]; // TRP - Create NSDictionary with contents of the plist NSDictionary *addictionDict = [NSDictionary dictionaryWithContentsOfFile:filePath]; // TRP - Create an array with contents of the dictionary NSArray *addictionData = [addictionDict objectForKey:@"Addiction1"]; NSLog(@"addictionData (array): %@", addictionData); // TRP - Create a string with the contents of the array NSString *addictionText = [NSString stringWithFormat:@"<DIV style='font-family:%@;font-size:%d;'>%@</DIV>", @"Helvetica", 18, [addictionData objectAtIndex:1]]; addictionInfo.backgroundColor = [UIColor clearColor]; // TRP - Load the string created and stored into addictionText and display in the UIWebView [addictionInfo loadHTMLString:addictionText baseURL:nil]; // TODO: MAKE THIS WEBVIEW SCROLL!!!!!! } In the nib, I connected my web view to the delegate and to the outlet. When I run my main project, the plist with my HTML code shows up, but does not scroll. I copied and pasted this code into a new project, wired the nib the exact same way, and badda-boom badda-bing. . . it works. I even tried to create a new nib from scratch in this project, and the exact same code would not work. Whiskey Tango Foxtrot Any ideas?? Thanks! Thomas

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >